mirror of
https://github.com/zeek/zeek.git
synced 2025-10-08 17:48:21 +00:00
make curr_CPU_time() broadly available rather than just isolated to ZAM
This commit is contained in:
parent
aa5a5b2136
commit
41aee03c17
3 changed files with 14 additions and 11 deletions
|
@ -2058,6 +2058,13 @@ int time_compare(struct timeval* tv_a, struct timeval* tv_b)
|
|||
return tv_a->tv_sec - tv_b->tv_sec;
|
||||
}
|
||||
|
||||
double curr_CPU_time()
|
||||
{
|
||||
struct timespec ts;
|
||||
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts);
|
||||
return double(ts.tv_sec) + double(ts.tv_nsec) / 1e9;
|
||||
}
|
||||
|
||||
struct UIDEntry
|
||||
{
|
||||
UIDEntry() : key(0, 0), needs_init(true) { }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue