clock: buff our coverage numbers slightly.
clock_gettime() with known arguments can't fail (and we ignore its return value in most other places already). Test: treehugger Change-Id: I2374ae5ba1598a01d4c4f689b9c75c4e7dc926b6
This commit is contained in:
parent
700f753c50
commit
09e394f92a
1 changed files with 1 additions and 3 deletions
|
@ -35,8 +35,6 @@
|
|||
// http://pubs.opengroup.org/onlinepubs/9699919799/functions/clock.html
|
||||
clock_t clock() {
|
||||
timespec ts;
|
||||
if (clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts) == -1) {
|
||||
return -1;
|
||||
}
|
||||
clock_gettime(CLOCK_PROCESS_CPUTIME_ID, &ts);
|
||||
return (ts.tv_sec * CLOCKS_PER_SEC) + (ts.tv_nsec / (NS_PER_S / CLOCKS_PER_SEC));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue