]> git.lizzy.rs Git - rust.git/commit
[Windows] Work around non-monotonic clocks in the self-profiler
authorWesley Wiser <wwiser@gmail.com>
Thu, 22 Nov 2018 18:05:25 +0000 (13:05 -0500)
committerWesley Wiser <wwiser@gmail.com>
Sun, 25 Nov 2018 02:38:35 +0000 (21:38 -0500)
commitdce1c4530e2707c338fe56b26a36797377f11514
tree2184726a4691138c85765766cc07a851575fef62
parentb319715456c08097f2cd936da309ed6e8aec2843
[Windows] Work around non-monotonic clocks in the self-profiler

On Windows, the high-resolution timestamp api doesn't seem to always be
monotonic. This can cause panics when the self-profiler uses the
`Instant` api to find elapsed time.

Work around this by detecting the case where now is less than the start
time and just use 0 elapsed ticks as the measurement.

Fixes #51648
src/librustc/util/profiling.rs