-betterC works on linux with DMD

This commit is contained in:
Mergul 2019-10-11 19:05:41 +02:00
parent 633aad6cb7
commit cde772c077
2 changed files with 24 additions and 3 deletions

View file

@ -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
{