source:
CIVL/examples/omp/nas-dc/common/wtime.c@
02876df
| Last change on this file since 02876df was f2eb077, checked in by , 10 years ago | |
|---|---|
|
|
| File size: 290 bytes | |
| Rev | Line | |
|---|---|---|
| [f2eb077] | 1 | #include "wtime.h" |
| 2 | #include <time.h> | |
| 3 | #ifndef DOS | |
| 4 | #include <sys/time.h> | |
| 5 | #endif | |
| 6 | ||
| 7 | void wtime(double *t) | |
| 8 | { | |
| 9 | /* a generic timer */ | |
| 10 | static int sec = -1; | |
| 11 | struct timeval tv; | |
| 12 | gettimeofday(&tv, (void *)0); | |
| 13 | if (sec < 0) sec = tv.tv_sec; | |
| 14 | *t = (tv.tv_sec - sec) + 1.0e-6*tv.tv_usec; | |
| 15 | } | |
| 16 |
Note:
See TracBrowser
for help on using the repository browser.
