Files CCore/inc/sys/SysTime.h CCore/src/sys/SysTime.cpp
This part provides OS backed time functions. CCore uses three time functions, which provides continuous times with different resolutions.
#ifndef CCore_inc_sys_SysTime_h #define CCore_inc_sys_SysTime_h #include <CCore/inc/Gadget.h> namespace CCore { namespace Sys { /* types */ using MSecTimeType = .... ; // unsigned integral type using SecTimeType = .... ; // unsigned integral type using ClockTimeType = .... ; // unsigned integral type /* functions */ MSecTimeType GetMSecTime() noexcept; SecTimeType GetSecTime() noexcept; ClockTimeType GetClockTime() noexcept; } // namespace Sys } // namespace CCore #endif
GetMSecTime() returns a millisecond time. The return value has the type MSecTimeType. It must be an unsigned integral type.
GetSecTime() returns a second time. The return value has the type SecTimeType. It must be an unsigned integral type.
GetClockTime() returns a "clock" time. It must be a fastest available time resolution on the target, with resolution at least 1 microsecond. The return value has the type ClockTimeType. It must be an unsigned integral type. Its recommended, that this type has 64 bits width.