00001 #ifndef __J2K__Measure_HPP__ 00002 #define __J2K__Measure_HPP__ 00003 00004 #include <j2k/Fred/Standard.hpp> 00005 #include <sys/neutrino.h> 00006 #include <sys/syspage.h> 00007 00008 class Measure 00009 { 00010 public: 00011 static const ULONG Period_1_ms; 00012 static const ULONG Period_10_ms; 00013 static const ULONG Period_100_ms; 00014 00015 00016 Measure(); 00017 00018 void setClockPeriod( ULONG nsec = Period_1_ms ); 00019 00020 inline _uint64 getCycles(); 00021 inline double getCPUfreq(); 00022 inline ULONG getClockPeriod(); 00023 00024 inline double start(); 00025 inline double stop(); 00026 00027 inline double getElapsed(); 00028 00029 inline void print(); 00030 00031 Measure( const Measure& src ); 00032 const Measure& operator = ( const Measure& src ); 00033 00034 protected: 00035 00036 static double cpu_freq; 00037 static ULONG clock_period; 00038 00039 private: 00040 double elapsed; 00041 00042 _uint64 start_time; 00043 _uint64 stop_time; 00044 00045 struct _clockperiod clkper; 00046 00047 }; 00048 00049 00050 #include <j2k/nto/Measure.inl> 00051 00052 #endif