Skip to content

add Timer::record_scoped RAII guard#82

Merged
bartoszmodelski merged 2 commits into
mainfrom
timer-record-scoped
May 21, 2026
Merged

add Timer::record_scoped RAII guard#82
bartoszmodelski merged 2 commits into
mainfrom
timer-record-scoped

Conversation

@bartoszmodelski
Copy link
Copy Markdown
Contributor

Summary

  • New Timer::record_scoped() method that starts the timer and returns a ScopedRecord guard
  • Guard calls record_processing() automatically on drop

Usage:

fn my_function(&mut self) {
    let _guard = self.timer.record_scoped();
    // ... work ...
} // record_processing() fires here

Test plan

  • cargo check -p flux-communication

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bartoszmodelski bartoszmodelski requested a review from a team May 21, 2026 14:10
}

#[inline]
pub fn record_scoped(&mut self) -> ScopedRecord<'_> {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#[must_use]

just in case :)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bartoszmodelski bartoszmodelski merged commit f6338d4 into main May 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants