Struct hprof::Profiler
[−]
[src]
pub struct Profiler { /* fields omitted */ }
A single tree of profile data.
Methods
impl Profiler
[src]
fn new(name: &'static str) -> Profiler
Create a new profiler with the given name for the root node.
fn enter(&self, name: &'static str) -> ProfileGuard
Enter a profile node for name
, returning a guard object that will leave
on destruction.
fn enter_noguard(&self, name: &'static str)
Enter a profile node for name
.
fn leave(&self)
Leave the current profile node.
fn print_timing(&self)
Print out the current timing information in a very naive way.
fn root(&self) -> Rc<ProfileNode>
Return the root profile node for inspection.
This root will always be valid and reflect the current state of the Profiler
.
It is not advised to inspect the data between calls to start_frame
and end_frame
.
fn end_frame(&self)
Finish a frame.
Logs an error if there are pending leave
calls, and later attempts to
print timing data will be met with sadness in the form of NaN
s.
fn start_frame(&self)
Start a frame.
Resets timing data. Logs an error if there are pending leave
calls, but there are
otherwise no ill effects.
fn disable(&self)
Disable the profiler.
All calls until enable
will do nothing.
fn enable(&self)
Enable the profiler.
Calls will take effect until disable
is called.
fn toggle(&self)
Toggle the profiler enabledness.