We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No response
I would want to have a way to assing time/start_time of a metric so I have a better control over it, instead of using SystemTime::now
pub(crate) struct AggregateTimeInitiator(Mutex<SystemTime>); impl AggregateTimeInitiator { pub(crate) fn delta(&self) -> AggregateTime { let current_time = SystemTime::now(); let start_time = self .0 .lock() .map(|mut start| replace(start.deref_mut(), current_time)) .unwrap_or(current_time); AggregateTime { start: start_time, current: current_time, } } pub(crate) fn cumulative(&self) -> AggregateTime { let current_time = SystemTime::now(); let start_time = self.0.lock().map(|start| *start).unwrap_or(current_time); AggregateTime { start: start_time, current: current_time, } } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Related Problems?
No response
Describe the solution you'd like:
I would want to have a way to assing time/start_time of a metric so I have a better control over it, instead of using SystemTime::now
Considered Alternatives
No response
Additional Context
No response
The text was updated successfully, but these errors were encountered: