We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
start_poll
1 parent 359a4e7 commit 4a88b28Copy full SHA for 4a88b28
console-subscriber/src/stats.rs
@@ -518,17 +518,8 @@ impl<H: RecordDuration> PollStats<H> {
518
None => return, // Async operations record polls, but not wakes
519
};
520
521
- let elapsed = match at.checked_duration_since(scheduled) {
522
- Some(elapsed) => elapsed,
523
- None => {
524
- eprintln!(
525
- "possible Instant clock skew detected: a poll's start timestamp \
526
- was before the wake time/last poll end timestamp\nwake = {:?}\n start = {:?}",
527
- scheduled, at
528
- );
529
- return;
530
- }
531
- };
+ // `at < scheduled` is possible when a task switches threads between polls.
+ let elapsed = at.saturating_duration_since(scheduled);
532
533
// if we have a scheduled time histogram, add the timestamp
534
timestamps.scheduled_histogram.record_duration(elapsed);
0 commit comments