Index: kernel/current/ChangeLog =================================================================== RCS file: /cvs/ecos/ecos/packages/kernel/current/ChangeLog,v retrieving revision 1.122 diff -u -r1.122 ChangeLog --- kernel/current/ChangeLog 15 Dec 2004 12:25:06 -0000 1.122 +++ kernel/current/ChangeLog 24 Feb 2005 14:16:45 -0000 @@ -1,3 +1,8 @@ +2005-12-24 Laurent Gonzalez + + * tests/tm_basic.cxx: fix over-estimated cost of clock + interrupt. + 2004-12-15 Sergei Organov * cdl/scheduler.cdl: Correct the description of Index: kernel/current/tests/tm_basic.cxx =================================================================== RCS file: /cvs/ecos/ecos/packages/kernel/current/tests/tm_basic.cxx,v retrieving revision 1.21 diff -u -r1.21 tm_basic.cxx --- kernel/current/tests/tm_basic.cxx 19 Feb 2004 10:57:36 -0000 1.21 +++ kernel/current/tests/tm_basic.cxx 24 Feb 2005 14:16:52 -0000 @@ -232,7 +232,7 @@ show_ticks_in_us(cyg_uint32 ticks) { long long ns; - ns = (ns_per_system_clock * (long long)ticks) / CYGNUM_KERNEL_COUNTERS_RTC_PERIOD; + ns = (ns_per_system_clock * (long long)ticks / 1000) / CYGNUM_KERNEL_COUNTERS_RTC_PERIOD; ns += 5; // for rounding to .01us diag_printf("%5d.%02d", (int)(ns/1000), (int)((ns%1000)/10)); } @@ -1666,7 +1666,7 @@ cyg_thread_delay(2); // Make sure the clock is actually running - ns_per_system_clock = 1000000/rtc_resolution[1]; + ns_per_system_clock = rtc_resolution[0]/rtc_resolution[1]; wait_for_tick(); for (i = 0; i < nsamples; i++) { @@ -1696,7 +1696,7 @@ tv1 += tv[i] * 1000; } tv1 = tv1 / nsamples; - tv1 -= overhead; // Adjust out the cost of getting the timer value + tv1 -= 1000 * overhead; // Adjust out the cost of getting the timer value diag_printf("Clock interrupt took"); show_ticks_in_us(tv1); diag_printf(" microseconds (%d raw clock ticks)\n", tv1/1000); @@ -1779,7 +1779,7 @@ enable_clock_latency_measurement(); ticks = cyg_current_time(); - diag_printf("\nTiming complete - %d ms total\n\n", (int)((ticks*ns_per_system_clock)/1000)); + diag_printf("\nTiming complete - %d ms total\n\n", (int)((ticks*ns_per_system_clock)/1000000)); } void