time
This commit is contained in:
@@ -611,6 +611,17 @@ typedef struct ThreadContext {
|
||||
LaneCtx lane_ctx;
|
||||
} ThreadContext;
|
||||
|
||||
typedef struct HumanTime {
|
||||
i16 year;
|
||||
u8 month;
|
||||
u8 month_i;
|
||||
u8 date;
|
||||
u8 hour;
|
||||
u8 min;
|
||||
u8 sec;
|
||||
u8 zone;
|
||||
} HumanTime;
|
||||
|
||||
///// HARDCODED GLOBALS
|
||||
global const u64 MAX_u64 = 0xffffffffffffffffull;
|
||||
global const i64 MAX_i64 = 9223372036854775807LL;
|
||||
@@ -627,6 +638,19 @@ global const u8 MAX_u8 = 0xff;
|
||||
#ifndef SQRT_3
|
||||
# define SQRT_3 (1.7320508076)
|
||||
#endif
|
||||
#ifndef ONE_MILLION
|
||||
# define ONE_MILLION (1000000)
|
||||
#endif
|
||||
#ifndef ONE_THOUSAND
|
||||
# define ONE_THOUSAND (1000)
|
||||
#endif
|
||||
#ifndef MICROSECONDS_PER_SECOND
|
||||
# define MICROSECONDS_PER_SECOND ONE_MILLION
|
||||
#endif
|
||||
#ifndef NANOSECONDS_PER_MICROSECOND
|
||||
# define NANOSECONDS_PER_MICROSECOND ONE_THOUSAND
|
||||
#endif
|
||||
|
||||
|
||||
///// CUSTOM ENTRY POINT
|
||||
/* TODO?
|
||||
@@ -732,8 +756,10 @@ fn void* osMemoryReserve(u64 size);
|
||||
fn void osMemoryCommit(void* memory, u64 size);
|
||||
fn void osMemoryDecommit(void* memory, u64 size);
|
||||
fn void osMemoryRelease(void* memory, u64 size);
|
||||
|
||||
fn u64 osTimeMicrosecondsNow();
|
||||
fn void osSleepMicroseconds(u32 t);
|
||||
fn HumanTime osHumanTimeFromMicroseconds(u64 micros);
|
||||
|
||||
// Files
|
||||
fn bool osFileExists(String filename);
|
||||
@@ -808,7 +834,9 @@ typedef struct StringArena {
|
||||
Mutex mutex;
|
||||
} StringArena;
|
||||
|
||||
#define stringChunkListAlloc(a, s) allocStringChunkList(a, s)
|
||||
fn StringChunkList allocStringChunkList(StringArena* a, String string);
|
||||
#define stringChunkListRelease(a, l) releaseStringChunkList(a, l)
|
||||
fn void releaseStringChunkList(StringArena* a, StringChunkList* list);
|
||||
fn String stringChunkToString(Arena* a, StringChunkList list);
|
||||
fn String stringChunkToStringWithPadding(Arena* a, StringChunkList list, u32 extra);
|
||||
|
||||
Reference in New Issue
Block a user