pub struct TimedTask { /* private fields */ }Expand description
Equivalent to Ipopt::TimedTask. Use TimedTask::start /
TimedTask::end around a section to accumulate cpu/system/wall
time. TimedTask::end_if_started is the exception-safe variant.
Implementations§
Source§impl TimedTask
impl TimedTask
pub fn new() -> Self
pub fn enable(&self)
pub fn disable(&self)
pub fn is_enabled(&self) -> bool
pub fn is_started(&self) -> bool
pub fn reset(&self)
pub fn start(&self)
pub fn end(&self)
pub fn end_if_started(&self)
pub fn total_cpu_time(&self) -> Number
pub fn total_sys_time(&self) -> Number
pub fn total_wallclock_time(&self) -> Number
Sourcepub fn live_wallclock_time(&self) -> Number
pub fn live_wallclock_time(&self) -> Number
Running wallclock seconds since start() plus accumulated total
from prior start/end cycles. When the task is not currently
started this is the same as Self::total_wallclock_time.
Used by OptErrorConvCheck to gate max_wall_time mid-solve
without forcing a start()/end() round-trip every iter.
Sourcepub fn live_cpu_time(&self) -> Number
pub fn live_cpu_time(&self) -> Number
Live counterpart of Self::total_cpu_time; see
Self::live_wallclock_time for the contract.
Sourcepub fn guard(&self) -> TimedGuard<'_>
pub fn guard(&self) -> TimedGuard<'_>
RAII-style guard: start the timer immediately, end it when the
returned value is dropped (or when TimedGuard::stop is
called). Survives early returns / ? in the caller scope.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for TimedTask
impl !RefUnwindSafe for TimedTask
impl !Sync for TimedTask
impl Send for TimedTask
impl Unpin for TimedTask
impl UnsafeUnpin for TimedTask
impl UnwindSafe for TimedTask
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