00001 #ifndef __J2K__Measure_CPP__
00002 #define __J2K__Measure_CPP__
00003
00004
00005 #include <j2k/nto/Measure.hpp>
00006
00007
00008 const ULONG Measure::Period_1_ms = 1000000L;
00009 const ULONG Measure::Period_10_ms = 10000000L;
00010 const ULONG Measure::Period_100_ms = 100000000L;
00011
00012 double Measure::cpu_freq = 0.00f;
00013 ULONG Measure::clock_period = Period_1_ms;
00014
00015 Measure::Measure()
00016 : elapsed( 0.0f ), start_time( 0ull ), stop_time( 0ull )
00017 {
00018
00019
00020 cpu_freq = SYSPAGE_ENTRY( qtime )->cycles_per_sec;
00021
00022 setClockPeriod();
00023 }
00024
00025 void Measure::setClockPeriod( ULONG nsec = Period_1_ms )
00026 {
00027
00028
00029
00030
00031
00032 clock_period = nsec;
00033
00034
00035 clkper.nsec = nsec;
00036 clkper.fract = 0;
00037 ClockPeriod( CLOCK_REALTIME, &clkper, NULL, 0 );
00038 }
00039
00040
00041 #endif