Merge pull request #60 from emma-eva/patch-1
Fixed time_in_ms() compile time error (termux and neoterm)
This commit is contained in:
@@ -355,9 +355,14 @@ int argmax(float* v, int n) {
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
long time_in_ms() {
|
long time_in_ms() {
|
||||||
struct timespec time;
|
struct timespec time;
|
||||||
timespec_get(&time, TIME_UTC);
|
// Get the current time with nanosecond precision
|
||||||
return time.tv_sec * 1000 + time.tv_nsec / 1000000;
|
if (clock_gettime(CLOCK_REALTIME, &time) == 0) {
|
||||||
|
return time.tv_sec * 1000 + time.tv_nsec / 1000000;
|
||||||
|
} else {
|
||||||
|
perror("clock_gettime");
|
||||||
|
return -1; // Return -1 to indicate an error
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
|
|||||||
Reference in New Issue
Block a user