Return the UNIX time in microseconds */
| 1567 | |
| 1568 | /* Return the UNIX time in microseconds */ |
| 1569 | static long long ustime(void) { |
| 1570 | struct timeval tv; |
| 1571 | long long ust; |
| 1572 | |
| 1573 | gettimeofday(&tv, NULL); |
| 1574 | ust = ((long long)tv.tv_sec) * 1000000; |
| 1575 | ust += tv.tv_usec; |
| 1576 | return ust; |
| 1577 | } |
| 1578 | |
| 1579 | /* Return the UNIX time in milliseconds */ |
| 1580 | static long long mstime(void) { return ustime() / 1000; } |