----- time ----- */
| 526 | |
| 527 | /* ----- time ----- */ |
| 528 | int64 time_get() |
| 529 | { |
| 530 | #if defined(CONF_FAMILY_UNIX) |
| 531 | struct timeval val; |
| 532 | gettimeofday(&val, NULL); |
| 533 | return (int64)val.tv_sec*(int64)1000000+(int64)val.tv_usec; |
| 534 | #elif defined(CONF_FAMILY_WINDOWS) |
| 535 | static int64 last = 0; |
| 536 | int64 t; |
| 537 | QueryPerformanceCounter((PLARGE_INTEGER)&t); |
| 538 | if(t<last) /* for some reason, QPC can return values in the past */ |
| 539 | return last; |
| 540 | last = t; |
| 541 | return t; |
| 542 | #else |
| 543 | #error not implemented |
| 544 | #endif |
| 545 | } |
| 546 | |
| 547 | int64 time_freq() |
| 548 | { |
no outgoing calls
no test coverage detected