-betterC works on linux with DMD
This commit is contained in:
parent
633aad6cb7
commit
cde772c077
2 changed files with 24 additions and 3 deletions
|
|
@ -27,6 +27,28 @@ version(Windows)
|
|||
}
|
||||
}
|
||||
}
|
||||
else version(Posix)
|
||||
{
|
||||
import core.sys.posix.time;
|
||||
struct Time
|
||||
{
|
||||
static long getUSecTime()
|
||||
{
|
||||
time_t time;
|
||||
timespec spec;
|
||||
|
||||
clock_gettime(CLOCK_REALTIME, &spec);
|
||||
|
||||
//time = spec.tv_sec;
|
||||
return spec.tv_sec * 1000_000 + spec.tv_nsec / 1000;//time / 1000_000;
|
||||
|
||||
/*LARGE_INTEGER time, freq;
|
||||
QueryPerformanceFrequency(&freq);
|
||||
QueryPerformanceCounter(&time);
|
||||
return time.QuadPart / (freq.QuadPart / 1000_000);*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct TestEvent
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue