35 #ifndef _BLAZE_UTIL_TIME_H_
36 #define _BLAZE_UTIL_TIME_H_
50 # include <sys/timeb.h>
52 # include <sys/resource.h>
53 # include <sys/time.h>
54 # include <sys/types.h>
92 localTime = std::localtime( &t );
93 std::strftime( c, 50,
"%Y-%m-%d", localTime );
95 return std::string( c );
113 localTime = std::localtime( &t );
114 std::strftime( c, 50,
"%A, %d.%B %Y, %H:%M", localTime );
116 return std::string( c );
130 struct _timeb timeptr;
132 return ( static_cast<double>( timeptr.time ) + static_cast<double>( timeptr.millitm )/1E3 );
135 gettimeofday( &tp,
NULL );
136 return ( static_cast<double>( tp.tv_sec ) + static_cast<double>( tp.tv_usec )/1E6 );
151 FILETIME CreateTime, ExitTime, KernelTime, UserTime;
154 if( GetProcessTimes( GetCurrentProcess(), &CreateTime, &ExitTime, &KernelTime, &UserTime ) != TRUE ) {
158 FileTimeToSystemTime( &UserTime, &SysTime );
159 return ( static_cast<double>( SysTime.wSecond ) + static_cast<double>( SysTime.wMilliseconds )/1E3 );
163 getrusage( RUSAGE_SELF, &ruse );
164 return ( static_cast<double>( ruse.ru_utime.tv_sec ) + static_cast<double>( ruse.ru_utime.tv_usec )/1E6 );
const blaze::Null NULL
Global NULL pointer.This instance of the Null class replaces the NULL macro to ensure a type-safe NUL...
Definition: Null.h:300
std::string getDate()
Creating a formated date string in the form YYYY-MM-DD.
Definition: Time.h:85
Header file for time functions.
double getCpuTime()
Returns the current CPU time in seconds.
Definition: Time.h:148
std::string getTime()
Creating a formated time and date string.
Definition: Time.h:106
double getWcTime()
Returns the current wall clock time in seconds.
Definition: Time.h:127