Skip to content

Commit d18e9ef

Browse files
authored
Merge pull request ggml-org#48 from richinseattle/richinseattle-patch-1
MSVC Compatibility fix for timer
2 parents cae88df + b2857c6 commit d18e9ef

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

run.c

+3-4
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ Then run with:
1313
#include <time.h>
1414
#include <math.h>
1515
#include <string.h>
16-
#include <sys/time.h>
1716

1817
// ----------------------------------------------------------------------------
1918
// Transformer and RunState structs, and related memory management
@@ -378,9 +377,9 @@ int argmax(float* v, int n) {
378377
// ----------------------------------------------------------------------------
379378

380379
long time_in_ms() {
381-
struct timeval time;
382-
gettimeofday(&time, NULL);
383-
return time.tv_sec * 1000 + time.tv_usec / 1000;
380+
struct timespec time;
381+
timespec_get(&time, TIME_UTC);
382+
return time.tv_sec * 1000 + time.tv_nsec / 1000000;
384383
}
385384

386385
int main(int argc, char *argv[]) {

0 commit comments

Comments
 (0)