move nsTime to its own file
This commit is contained in:
parent
81a47f1386
commit
d68e278083
@ -1,6 +1,7 @@
|
||||
#include "../core.h"
|
||||
#include "../utils/each.h"
|
||||
#include "../utils/file.h"
|
||||
#include "../utils/time.h"
|
||||
#include "../builtins.h"
|
||||
|
||||
|
||||
|
||||
@ -8,6 +8,7 @@
|
||||
#include "../utils/file.h"
|
||||
#include "../utils/wyhash.h"
|
||||
#include "../utils/mut.h"
|
||||
#include "../utils/time.h"
|
||||
#include "../builtins.h"
|
||||
#include "../ns.h"
|
||||
#include "../nfns.h"
|
||||
|
||||
8
src/h.h
8
src/h.h
@ -611,11 +611,3 @@ static B m_fork(B f, B g, B h);
|
||||
static B m_atop( B g, B h);
|
||||
|
||||
|
||||
|
||||
#include <time.h>
|
||||
static inline u64 nsTime() {
|
||||
struct timespec t;
|
||||
// timespec_get(&t, TIME_UTC); // doesn't seem to exist on Android
|
||||
clock_gettime(CLOCK_REALTIME, &t);
|
||||
return (u64)(t.tv_sec*1000000000ll + t.tv_nsec);
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
#include "ns.h"
|
||||
#include "utils/utf.h"
|
||||
#include "utils/file.h"
|
||||
#include "utils/time.h"
|
||||
|
||||
static B replPath;
|
||||
static Scope* gsc;
|
||||
|
||||
@ -1,4 +1,9 @@
|
||||
#include "gc.h"
|
||||
|
||||
#ifdef LOG_GC
|
||||
#include "../utils/time.h"
|
||||
#endif
|
||||
|
||||
u64 gc_depth = 1;
|
||||
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
#ifdef RT_PERF
|
||||
#include "builtins.h"
|
||||
#endif
|
||||
#include "utils/time.h"
|
||||
|
||||
#ifdef RT_WRAP
|
||||
typedef struct WFun WFun;
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
#include "../core.h"
|
||||
#include "hash.h"
|
||||
#include "time.h"
|
||||
|
||||
u64 wy_secret[4];
|
||||
|
||||
|
||||
9
src/utils/time.h
Normal file
9
src/utils/time.h
Normal file
@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <time.h>
|
||||
static inline u64 nsTime() {
|
||||
struct timespec t;
|
||||
// timespec_get(&t, TIME_UTC); // doesn't seem to exist on Android
|
||||
clock_gettime(CLOCK_REALTIME, &t);
|
||||
return (u64)(t.tv_sec*1000000000ll + t.tv_nsec);
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user