pub struct ProcessSpan { /* private fields */ }Expand description
Use this to track processor times for code that runs on any thread.
A span of code for which we track process processor time between creation and drop.
Measures processor time consumed by the entire process (all threads).
§Examples
use all_the_time::Session;
let session = Session::new();
let operation = session.operation("test");
{
let _span = operation.iterations(1).measure_process();
// Perform some processor-intensive operation
let mut sum = 0;
for i in 0..1000 {
sum += i;
}
} // Process processor time is automatically tracked and recorded hereFor benchmarks with many iterations:
use all_the_time::Session;
let session = Session::new();
let operation = session.operation("benchmark");
{
let _span = operation.iterations(1000).measure_process();
for i in 0..1000 {
// Perform the operation being benchmarked
let mut sum = 0;
sum += i;
}
} // Processor time is measured once and divided by 1000Trait Implementations§
Source§impl Debug for ProcessSpan
impl Debug for ProcessSpan
Auto Trait Implementations§
impl Freeze for ProcessSpan
impl !RefUnwindSafe for ProcessSpan
impl Send for ProcessSpan
impl !Sync for ProcessSpan
impl Unpin for ProcessSpan
impl UnwindSafe for ProcessSpan
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more