mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-04 23:28:07 +02:00
perf: Handle 32-bit wraparound of performance counter
This commit is contained in:
parent
b64645c567
commit
b866069210
1 changed files with 3 additions and 0 deletions
|
|
@ -144,6 +144,9 @@ cairo_perf_timer_elapsed (void) {
|
|||
cairo_perf_ticks_t ticks;
|
||||
|
||||
#ifdef OIL_STAMP
|
||||
/* Handle 32-bit wraparound of timer value */
|
||||
if (timer.stop < timer.start)
|
||||
timer.stop += 0x100000000ll;
|
||||
ticks = (timer.stop - timer.start);
|
||||
#else
|
||||
ticks = (timer.tv_stop.tv_sec - timer.tv_start.tv_sec) * 1000000;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue