version 1.259, 2011/11/21 01:37:12
|
version 1.261, 2011/12/02 21:59:09
|
Line 2035 dsystem = DZERO;
|
Line 2035 dsystem = DZERO;
|
|
|
ntime ( -- dtime ) gforth |
ntime ( -- dtime ) gforth |
""Report the current time in nanoseconds since some epoch."" |
""Report the current time in nanoseconds since some epoch."" |
struct timespec t; |
#ifdef HAVE_CLOCK_GETTIME |
clock_gettime(CLOCK_REALTIME,&t); |
struct timespec time1; |
dtime = timespec2ns(&t); |
clock_gettime(CLOCK_REALTIME,&time1); |
|
dtime = timespec2ns(&time1); |
|
#else |
|
struct timeval time1; |
|
gettimeofday(&time1,NULL); |
|
dtime = timeval2us(&time1) * 1000LL; |
|
#endif |
|
|
\+ |
\+ |
|
|