Merge pull request #48 from richinseattle/richinseattle-patch-1
MSVC Compatibility fix for timer
This commit is contained in:
@@ -13,7 +13,6 @@ $ ./run
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/time.h>
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// Transformer and RunState structs, and related memory management
|
// Transformer and RunState structs, and related memory management
|
||||||
@@ -378,9 +377,9 @@ int argmax(float* v, int n) {
|
|||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
long time_in_ms() {
|
long time_in_ms() {
|
||||||
struct timeval time;
|
struct timespec time;
|
||||||
gettimeofday(&time, NULL);
|
timespec_get(&time, TIME_UTC);
|
||||||
return time.tv_sec * 1000 + time.tv_usec / 1000;
|
return time.tv_sec * 1000 + time.tv_nsec / 1000000;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
|
|||||||
Reference in New Issue
Block a user