MXS-2160 Use CLOCK_MONOTONIC_COARSE

We measure time in milliseconds and as CLOCK_MONOTONIC_COARSE
provides 1ms granularity we should use that since it is cheaper.
This commit is contained in:
Johan Wikman
2018-11-13 11:40:57 +02:00
parent ad52834c9b
commit ae1a062a58
2 changed files with 15 additions and 25 deletions

View File

@ -97,7 +97,7 @@ public:
*/
void reset()
{
uint64_t now = get_time();
uint64_t now = get_time_ms();
m_start_time = now;
m_wait_start = 0;
@ -116,7 +116,7 @@ public:
void about_to_wait()
{
about_to_wait(get_time());
about_to_wait(get_time_ms());
}
/**
@ -128,7 +128,7 @@ public:
void about_to_work()
{
about_to_work(get_time());
about_to_work(get_time_ms());
}
/**
@ -170,7 +170,7 @@ public:
*
* @return Current time in milliseconds.
*/
static uint64_t get_time();
static uint64_t get_time_ms();
private: