Skip to main content

TimedTask

Struct TimedTask 

Source
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

Source

pub fn new() -> Self

Source

pub fn enable(&self)

Source

pub fn disable(&self)

Source

pub fn is_enabled(&self) -> bool

Source

pub fn is_started(&self) -> bool

Source

pub fn reset(&self)

Source

pub fn start(&self)

Source

pub fn end(&self)

Source

pub fn end_if_started(&self)

Source

pub fn total_cpu_time(&self) -> Number

Source

pub fn total_sys_time(&self) -> Number

Source

pub fn total_wallclock_time(&self) -> Number

Source

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.

Source

pub fn live_cpu_time(&self) -> Number

Live counterpart of Self::total_cpu_time; see Self::live_wallclock_time for the contract.

Source

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§

Source§

impl Debug for TimedTask

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TimedTask

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.