Switch to using timespec_get() for cross OS compatibility

This commit is contained in:
richinseattle
2023-07-24 16:31:38 -07:00
committed by GitHub
parent f121f5f0c5
commit b2857c6af2
+3 -1
View File
@@ -377,7 +377,9 @@ int argmax(float* v, int n) {
// ----------------------------------------------------------------------------
long time_in_ms() {
return (1000 * clock()) / CLOCKS_PER_SEC;
struct timespec time;
timespec_get(&time, TIME_UTC);
return time.tv_sec * 1000 + time.tv_nsec / 1000000;
}
int main(int argc, char *argv[]) {