Main Page   Packages   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

C:/temp/src/j2k/Deprecated/old_18mar_diff/nto/Measure.cpp

Go to the documentation of this file.
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   // Get the CPU frequency in order to do a precide time calculation
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   // Set the system clock period to 1 ms, 
00028   // a frequency that works with any 40 MHz or higher speed
00029   // processor, including the low speed Elan-104 boards running at 66 MHz
00030   // and the blazing fast Pentium III.
00031 
00032   clock_period = nsec;
00033 
00034   // There is only two data member in clkper:
00035   clkper.nsec  = nsec;
00036   clkper.fract = 0;
00037   ClockPeriod( CLOCK_REALTIME, &clkper, NULL, 0 );  // 1 ms
00038 }
00039 
00040 
00041 #endif

Generated on Sun Oct 14 18:46:23 2001 for Standard J2K Library by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001