source:
CIVL/mods/dev.civl.com/examples/omp/nas-dc/common/wtime.c@
cb4d4f4
| Last change on this file since cb4d4f4 was aad342c, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 290 bytes | |
| Line | |
|---|---|
| 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.
