mirror of
https://github.com/pjreddie/darknet.git
synced 2023-08-10 21:13:14 +03:00
time stuff woof
This commit is contained in:
parent
259be3217b
commit
508381b37f
@ -7,6 +7,7 @@
|
|||||||
#include <float.h>
|
#include <float.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
@ -25,9 +26,11 @@ double get_wall_time()
|
|||||||
|
|
||||||
double what_time_is_it_now()
|
double what_time_is_it_now()
|
||||||
{
|
{
|
||||||
struct timespec now;
|
struct timeval time;
|
||||||
clock_gettime(CLOCK_REALTIME, &now);
|
if (gettimeofday(&time,NULL)){
|
||||||
return now.tv_sec + now.tv_nsec*1e-9;
|
return 0;
|
||||||
|
}
|
||||||
|
return (double)time.tv_sec + (double)time.tv_usec * .000001;
|
||||||
}
|
}
|
||||||
|
|
||||||
int *read_intlist(char *gpu_list, int *ngpus, int d)
|
int *read_intlist(char *gpu_list, int *ngpus, int d)
|
||||||
|
Loading…
Reference in New Issue
Block a user