Pol  Revision:f37d500
wallclock.cpp
Go to the documentation of this file.
1 
7 #include "wallclock.h"
8 
9 #ifndef _WIN32
10 #include <sys/time.h>
11 #else
12 #include <ctime>
13 #endif
14 
15 namespace Pol
16 {
17 namespace Clib
18 {
19 #ifdef _WIN32
21 {
22  return clock();
23 }
25 {
26  return ( ( finish - start ) * 1000L / CLOCKS_PER_SEC );
27 }
28 
29 #else
30 
32 {
33  struct timeval tmv;
34  struct timezone tz;
35  gettimeofday( &tmv, &tz );
36  return ( tmv.tv_sec ) * 1000 + tmv.tv_usec / 1000L;
37 }
39 {
40  return finish - start;
41 }
42 
43 #endif
44 }
45 }
wallclock_t wallclock()
Definition: wallclock.cpp:31
unsigned int wallclock_t
Definition: wallclock.h:8
wallclock_diff_t wallclock_diff_ms(wallclock_t start, wallclock_t finish)
Definition: wallclock.cpp:38
unsigned int wallclock_diff_t
Definition: wallclock.h:9
Definition: berror.cpp:12