Skip to content

Commit

Permalink
[Build] use timespec_get to get current time
Browse files Browse the repository at this point in the history
Replace clock_gettime with timespec_get which works on Windows as well.

For pytorch#4661
  • Loading branch information
python3kgae committed Sep 10, 2024
1 parent 37cad01 commit 92bac8e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion extension/llm/runner/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void inline safe_printf(const char* piece) {
long inline time_in_ms() {
// return time in milliseconds, for benchmarking the model speed
struct timespec time;
clock_gettime(CLOCK_REALTIME, &time);
timespec_get(&time, TIME_UTC);
return time.tv_sec * 1000 + time.tv_nsec / 1000000;
}

Expand Down

0 comments on commit 92bac8e

Please sign in to comment.