24 #include <sys/timeb.h>
47 explicit inline TimeMarker(
const struct timeb& timeMarker ) : m_Marker( timeMarker ) {}
52 return difftime( m_Marker.time, startMarker.
m_Marker.time )*1000 + m_Marker.millitm - startMarker.
m_Marker.millitm;
57 struct timeb m_Marker;
66 inline static string Get(
const string& timeformat,
const unsigned int bufferSize )
70 acttime = time( NULL );
71 return Get( timeformat, bufferSize, &acttime );
75 inline static string Get(
const string& timeformat,
const unsigned int bufferSize,
const time_t* acttime )
80 int localtimeResult = localtime_s( &timeptr, acttime );
81 if ( 0 != localtimeResult )
82 cerr <<
"Unable to aquire local time [" << localtimeResult <<
"]";
84 timeptr = *localtime( acttime );
87 char* formattedTime =
new char[ bufferSize + 1 ];
89 strftime( formattedTime, bufferSize + 1, timeformat.c_str(), &timeptr );
90 string returnValue( formattedTime, bufferSize );
92 if ( formattedTime != NULL )
93 delete[] formattedTime;
99 static double Compare(
const string& time1,
const string& time2,
const string& format );