remove second ifdefs for windows timing by introducing ported version of clock_gettime

This commit is contained in:
Aydyn Tairov
2023-07-27 15:38:45 +01:00
parent 79933a8ab4
commit acf1e18e8f
3 changed files with 16 additions and 9 deletions
-6
View File
@@ -365,15 +365,9 @@ int argmax(float* v, int n) {
// ----------------------------------------------------------------------------
long time_in_ms() {
#if defined _WIN32
// windows specific way to get time
return GetTickCount();
#else
// linux specific way to get time
struct timespec time;
clock_gettime(CLOCK_REALTIME, &time);
return time.tv_sec * 1000 + time.tv_nsec / 1000000;
#endif
}
int main(int argc, char *argv[]) {