Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
lib
misc
milliSeconds.cc
Go to the documentation of this file.
1
/* real_time.cc
2
*/
3
#include "
osl/misc/milliSeconds.h
"
4
#ifdef _WIN32
5
# include <sys/timeb.h>
6
#else
7
# include <sys/time.h>
8
#endif
9
const
osl::misc::MilliSeconds
osl::misc::MilliSeconds::now
()
10
{
11
#ifdef _WIN32
12
struct
_timeb now;
13
_ftime(&now);
// mingw does not support _ftime_s
14
return
MilliSeconds
((int64_t)now.time*1000 + now.millitm);
15
#else
16
timeval
now
;
17
gettimeofday(&now, 0);
18
return
MilliSeconds
((int64_t)now.tv_sec*1000 + now.tv_usec/1000);
19
#endif
20
}
21
22
/* ------------------------------------------------------------------------- */
23
// ;;; Local Variables:
24
// ;;; mode:c++
25
// ;;; c-basic-offset:2
26
// ;;; End:
Generated on Sun Jul 21 2013 13:37:25 by
1.8.4