pub struct ProfileEntry {
pub label: String,
pub elapsed_ms: f64,
pub timestamp_ms: f64,
}Expand description
A single recorded measurement.
Pushed onto the ProfilerHandle’s entries signal every time
the user calls ProfilerHandle::measure(label, f) (or
manually begin / end). Cheap to Clone (the inner
strings are small and f64 is Copy).
Field-level semantics:
label: free-form identifier — typically the call site name ("render-list","fetch-posts"). Empty strings are allowed but render as an empty chip in the UI, which makes misconfigured measurements obvious in a profiler readout.elapsed_ms: wall-clock time betweenbegin()and the matchingend()(or the duration of the measured closure), in milliseconds. Always>= 0.0—beginis captured before any user code runs, so the subtraction cannot underflow.timestamp_ms: the wall-clocknow_ms()value at the instant the entry was recorded (NOT the start of the measurement). This lets the UI sort / filter entries by when they were committed, not by when the user started the timer — which matters when entries are kept around for “last N measurements” readouts.
Fields§
§label: StringThe free-form label passed to measure / begin.
elapsed_ms: f64Duration of the measured operation, in milliseconds.
timestamp_ms: f64Wall-clock time at which the entry was recorded.
Implementations§
Source§impl ProfileEntry
impl ProfileEntry
pub fn get_label(&self) -> &String
pub fn get_mut_label(&mut self) -> &mut String
pub fn set_label(&mut self, val: String) -> &mut Self
pub fn get_elapsed_ms(&self) -> f64
pub fn get_mut_elapsed_ms(&mut self) -> &mut f64
pub fn set_elapsed_ms(&mut self, val: f64) -> &mut Self
pub fn get_timestamp_ms(&self) -> f64
pub fn get_mut_timestamp_ms(&mut self) -> &mut f64
pub fn set_timestamp_ms(&mut self, val: f64) -> &mut Self
Trait Implementations§
Source§impl Clone for ProfileEntry
impl Clone for ProfileEntry
Source§fn clone(&self) -> ProfileEntry
fn clone(&self) -> ProfileEntry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProfileEntry
impl Debug for ProfileEntry
Source§impl PartialEq for ProfileEntry
impl PartialEq for ProfileEntry
impl StructuralPartialEq for ProfileEntry
Auto Trait Implementations§
impl Freeze for ProfileEntry
impl RefUnwindSafe for ProfileEntry
impl Send for ProfileEntry
impl Sync for ProfileEntry
impl Unpin for ProfileEntry
impl UnsafeUnpin for ProfileEntry
impl UnwindSafe for ProfileEntry
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