system_clock can get the accurate current time, but it is not monotonic clock system.
So the time from system_clock can be jumped if initializing system_clock is delayed.
Therefore, system_clock is not good to check exact time delay.
However, this module use time for checking expired time of audio data.
Thus, monotonic clock system is better to meet this purpose.
Because of this reason, this patch changes time system from system_clock to steady_clock.
Change-Id: I3860646c0fe4fc814eeea907597363a17951e8ce
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
static long long get_current_milliseconds_after_epoch()
{
- auto now = chrono::system_clock::now();
+ auto now = chrono::steady_clock::now();
auto now_ms = chrono::time_point_cast<chrono::milliseconds>(now);
/* number of milliseconds since the epoch of system_clock */
auto value = now_ms.time_since_epoch();
static long long get_current_milliseconds_after_epoch()
{
- auto now = chrono::system_clock::now();
+ auto now = chrono::steady_clock::now();
auto now_ms = chrono::time_point_cast<chrono::milliseconds>(now);
/* number of milliseconds since the epoch of system_clock */
auto value = now_ms.time_since_epoch();
static long long get_current_milliseconds_after_epoch()
{
- auto now = chrono::system_clock::now();
+ auto now = chrono::steady_clock::now();
auto now_ms = chrono::time_point_cast<chrono::milliseconds>(now);
/* number of milliseconds since the epoch of system_clock */
auto value = now_ms.time_since_epoch();