27 std::chrono::high_resolution_clock
mTimer;
29 std::chrono::time_point<std::chrono::high_resolution_clock>
mStart;
47 auto now=std::chrono::system_clock::now();
48 time_t tnow = std::chrono::system_clock::to_time_t(now);
50 tm* ptm = localtime(&tnow);
51 mYear= ptm->tm_year + 1900;
100 inline std::chrono::duration<tReal>
stop() {
102 std::chrono::duration<tReal> duration= end-
mStart;
118 return (1000*(std::clock()-startTime))/CLOCKS_PER_SEC;
124 return std::chrono::duration_cast< std::chrono::milliseconds >( duration ).count();
130 return std::chrono::duration_cast< std::chrono::milliseconds >( duration ).count();
156 tReal ret=duration.count();
158 auto hours = std::chrono::duration_cast< std::chrono::hours >( duration );
164 auto minutes = std::chrono::duration_cast< std::chrono::minutes >( duration );
168 auto seconds = std::chrono::duration_cast< std::chrono::seconds >( duration );
172 auto milliseconds = std::chrono::duration_cast< std::chrono::milliseconds >( duration );
173 ms=milliseconds.count();
174 duration -= milliseconds;
176 auto microseconds = std::chrono::duration_cast< std::chrono::microseconds >( duration );
177 mus=microseconds.count();
178 duration -= microseconds;
180 auto nanoseconds = std::chrono::duration_cast< std::chrono::nanoseconds >( duration );
181 ns=nanoseconds.count();
211 tReal ret=duration.count();
213 auto hours = std::chrono::duration_cast< std::chrono::hours >( duration );
219 auto minutes = std::chrono::duration_cast< std::chrono::minutes >( duration );
223 auto seconds = std::chrono::duration_cast< std::chrono::seconds >( duration );
227 auto milliseconds = std::chrono::duration_cast< std::chrono::milliseconds >( duration );
228 ms=milliseconds.count();
229 duration -= milliseconds;
231 auto microseconds = std::chrono::duration_cast< std::chrono::microseconds >( duration );
232 mus=microseconds.count();
233 duration -= microseconds;
235 auto nanoseconds = std::chrono::duration_cast< std::chrono::nanoseconds >( duration );
236 ns=nanoseconds.count();
244 std::stringstream cstr;
248 cstr<<((int)
mMonth+1)<<
"-";
249 if (
mDay<10) cstr<<
"0";
252 if (
mHour<10) cstr<<
"0";
253 cstr<<((int)
mHour)<<
":";
this class describes the chono class by default write on standart output
Definition: CORE_Chrono.h:18
std::chrono::high_resolution_clock mTimer
Definition: CORE_Chrono.h:27
std::chrono::duration< tReal > stop()
stop the chrono and return the duration time in seconds as a real
Definition: CORE_Chrono.h:100
CORE_Chrono()
build a CORE_Chrono
Definition: CORE_Chrono.h:46
static tReal ConvertDuration(std::chrono::duration< tReal > &duration, tUInt &d, tUInt &h, tUInt &m, tUInt &s, tUInt &ms, tUInt &mus, tUInt &ns)
convert the duration as days,hours,minutes,second,milliseconds,microseconds
Definition: CORE_Chrono.h:200
tUCInt mHour
Definition: CORE_Chrono.h:35
std::chrono::time_point< std::chrono::high_resolution_clock > mStart
Definition: CORE_Chrono.h:29
tCInt mMonth
Definition: CORE_Chrono.h:32
tUInt mYear
Definition: CORE_Chrono.h:31
static tULLInt ConvertDuration(std::chrono::duration< tReal > &&duration)
convert duration in ms @retunr the duration in milli seconds
Definition: CORE_Chrono.h:123
static tString GetDate()
Definition: CORE_Chrono.h:261
tUCInt mDay
Definition: CORE_Chrono.h:33
tUCInt mWeekDay
Definition: CORE_Chrono.h:34
tUCInt mSecond
Definition: CORE_Chrono.h:37
static tULLInt GetClockTime()
Definition: CORE_Chrono.h:110
static tULLInt ConvertDuration(const std::chrono::duration< tReal > &duration)
convert duration in ms @retunr the duration in milli seconds
Definition: CORE_Chrono.h:129
tString getDate()
get the date in string
Definition: CORE_Chrono.h:243
void start()
start the chrono
Definition: CORE_Chrono.h:95
static tULLInt GetClockDuration(const tULLInt &startTime)
Definition: CORE_Chrono.h:117
tUCInt mMinute
Definition: CORE_Chrono.h:36
static tReal ConvertDuration(std::chrono::duration< tReal > &&duration, tUInt &d, tUInt &h, tUInt &m, tUInt &s, tUInt &ms, tUInt &mus, tUInt &ns)
convert the duration as days,hours,minutes,second,milliseconds,microseconds
Definition: CORE_Chrono.h:147
virtual tMemSize getMemorySize() const override
return the memory size of the class and the memory size of all its attributes/associations
Definition: CORE_Chrono.h:88
virtual ~CORE_Chrono(void)
destroy a CORE_Chrono
Definition: CORE_Chrono.h:69
abstract base class for most classes.
Definition: CORE_Object.h:48
virtual tMemSize getContentsMemorySize() const
return nthe memory size of the included associations
Definition: CORE_Object.h:259
#define tUInt
Definition: types.h:44
#define tString
Definition: types.h:147
#define tULLInt
Definition: types.h:58
#define tMemSize
Definition: types.h:166
#define tUCInt
Definition: types.h:26
#define tCInt
Definition: types.h:34
#define tReal
Definition: types.h:137