1 #include <ail/time.hpp>
6 #include <ail/environment.hpp>
9 #include <ail/windows.hpp>
12 #include <sys/times.h>
22 return static_cast<ulong
>(std::time(0));
28 ::SYSTEMTIME system_time
;
29 ::GetLocalTime(&system_time
);
30 ullong output
= time() * 1000ull + system_time
.wMilliseconds
;
32 ullong output
= time() * 1000ull;
34 ::gettimeofday(&time_value
, 0);
35 ::tm
* time_data
= ::localtime(&time_value
.tv_sec
);
36 output
+= static_cast<ullong
>(time_value
.tv_usec
/ 1000);
41 std::string
timestamp()
43 std::time_t current_time
;
44 std::time(¤t_time
);
45 std::tm
* pointer
= std::localtime(¤t_time
);
46 std::stringstream output
;
48 output
<< (pointer
->tm_year
+ 1900) << ".";
50 output
<< (pointer
->tm_mon
+ 1) << ".";
52 output
<< pointer
->tm_mday
<< " ";
54 output
<< pointer
->tm_hour
<< ":";
56 output
<< pointer
->tm_min
<< ":";
58 output
<< pointer
->tm_sec
;
66 #if (_WIN32_WINNT >= 0x0600)
67 return static_cast<ullong
>(::GetTickCount64());
69 return static_cast<ullong
>(::GetTickCount());
73 return static_cast<ullong
>(::times(&tm
));