Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLOCK_REALTIME always used in getTimeMonotonic #84

Open
lguptabb opened this issue Sep 21, 2021 · 2 comments
Open

CLOCK_REALTIME always used in getTimeMonotonic #84

lguptabb opened this issue Sep 21, 2021 · 2 comments

Comments

@lguptabb
Copy link

There's a typo here in CLOCK_MONOTONIC because of which CLOCK_REALTIME is always used in the getTimeMonotonic function which can cause unexpected behaviour.

void
getTimeMonotonic(TimeInternal * time)
{
#if defined(_POSIX_TIMERS) && (_POSIX_TIMERS > 0)

	struct timespec tp;
#ifndef CLOCK_MONOTINIC                                                                                                      
	if (clock_gettime(CLOCK_REALTIME, &tp) < 0) {
#else
	if (clock_gettime(CLOCK_MONOTONIC, &tp) < 0) {
@thomask77
Copy link

Duplicate of #77 ?

@wowczarek
Copy link
Member

Good find, I never noticed this. Easily fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants