move time stamps to unix file

master
Allen Webster 2017-06-30 18:39:47 -04:00
parent ae2cd40db8
commit deb9e46bdf
2 changed files with 14 additions and 13 deletions

View File

@ -51,7 +51,6 @@
#include <math.h> #include <math.h>
#include <stdlib.h> #include <stdlib.h>
#include <time.h>
#include <locale.h> #include <locale.h>
#include <memory.h> #include <memory.h>
#include <dlfcn.h> #include <dlfcn.h>
@ -242,20 +241,9 @@ internal void system_wait_cv(i32, i32);
internal void system_signal_cv(i32, i32); internal void system_signal_cv(i32, i32);
// //
// Time // File System
// //
internal
Sys_Now_Time_Sig(system_now_time){
struct timespec spec;
u64 result;
clock_gettime(CLOCK_REALTIME, &spec);
result = (spec.tv_sec * UINT64_C(1000000)) + (spec.tv_nsec / UINT64_C(1000));
return(result);
}
internal internal
Sys_File_Exists_Sig(system_file_exists){ Sys_File_Exists_Sig(system_file_exists){
int result = 0; int result = 0;

View File

@ -19,6 +19,7 @@
#include <dirent.h> #include <dirent.h>
#include <alloca.h> #include <alloca.h>
#include <errno.h> #include <errno.h>
#include <time.h>
#if defined(USE_LOG) #if defined(USE_LOG)
# include <stdio.h> # include <stdio.h>
@ -382,5 +383,17 @@ Sys_Save_File_Sig(system_save_file){
return (size == 0); return (size == 0);
} }
//
// Time
//
internal
Sys_Now_Time_Sig(system_now_time){
struct timespec spec;
clock_gettime(CLOCK_REALTIME, &spec);
u64 result = (spec.tv_sec * UINT64_C(1000000)) + (spec.tv_nsec / UINT64_C(1000));
return(result);
}
// BOTTOM // BOTTOM