fix: clock_gettime instead of clock
Clang Build CI / build-release (push) Has been cancelled
Clang Build CI / run-no-video (push) Has been cancelled
Clang Build CI / run-video (push) Has been cancelled
Clang Lint CI / lint-no-video (push) Successful in 1m14s
Clang Lint CI / lint-video (push) Successful in 1m16s
Clang Build CI / build-release (push) Has been cancelled
Clang Build CI / run-no-video (push) Has been cancelled
Clang Build CI / run-video (push) Has been cancelled
Clang Lint CI / lint-no-video (push) Successful in 1m14s
Clang Lint CI / lint-video (push) Successful in 1m16s
This commit is contained in:
+7
-1
@@ -7,7 +7,13 @@
|
||||
#include "config.h"
|
||||
#include "tempo.h"
|
||||
|
||||
static long now_ms() { return 1000 * clock() / CLOCKS_PER_SEC; }
|
||||
static long now_ms() {
|
||||
struct timespec ts;
|
||||
if (clock_gettime(CLOCK_REALTIME, &ts) != 0) {
|
||||
return 0;
|
||||
}
|
||||
return 1000 * ts.tv_sec + ts.tv_nsec / 1e6;
|
||||
}
|
||||
|
||||
static void reset_tap_chain(Tempo *tempo, long t) {
|
||||
tempo->last_reset = t;
|
||||
|
||||
Reference in New Issue
Block a user