| 58 | } |
| 59 | |
| 60 | double stamp_sub(const struct timeval& from, const struct timeval& sub) |
| 61 | { |
| 62 | #if 0 |
| 63 | struct timeval res; |
| 64 | |
| 65 | memcpy(&res, &from, sizeof(struct timeval)); |
| 66 | |
| 67 | res.tv_usec -= sub.tv_usec; |
| 68 | if (res.tv_usec < 0) { |
| 69 | --res.tv_sec; |
| 70 | res.tv_usec += 1000000; |
| 71 | } |
| 72 | |
| 73 | res.tv_sec -= sub.tv_sec; |
| 74 | return res.tv_sec * 1000.0 + res.tv_usec / 1000.0; |
| 75 | #else |
| 76 | |
| 77 | return (from.tv_sec - sub.tv_sec) * 1000 |
| 78 | + (from.tv_usec - sub.tv_usec) / 1000; |
| 79 | #endif |
| 80 | } |
| 81 | |
| 82 | } // namespace acl |
no test coverage detected
searching dependent graphs…