[][src]Struct opencv::core::TickMeter

pub struct TickMeter { /* fields omitted */ }

a Class to measure passing time.

The class computes passing time by counting the number of ticks per second. That is, the following code computes the execution time in seconds:

This example is not tested
TickMeter tm;
tm.start();
// do something ...
tm.stop();
std::cout << tm.getTimeSec();

It is also possible to compute the average time over multiple runs:

This example is not tested
TickMeter tm;
for (int i = 0; i < 100; i++)
{
tm.start();
// do something ...
tm.stop();
}
double average_time = tm.getTimeSec() / tm.getCounter();
std::cout << "Average time in second per iteration is: " << average_time << std::endl;

See also

getTickCount, getTickFrequency

Methods

impl TickMeter[src]

pub fn as_raw_TickMeter(&self) -> *mut c_void[src]

pub unsafe fn from_raw_ptr(ptr: *mut c_void) -> Self[src]

impl TickMeter[src]

pub fn default() -> Result<TickMeter>[src]

the default constructor

pub fn start(&mut self) -> Result<()>[src]

starts counting ticks.

pub fn stop(&mut self) -> Result<()>[src]

stops counting ticks.

pub fn get_time_ticks(&self) -> Result<i64>[src]

returns counted ticks.

pub fn get_time_micro(&self) -> Result<f64>[src]

returns passed time in microseconds.

pub fn get_time_milli(&self) -> Result<f64>[src]

returns passed time in milliseconds.

pub fn get_time_sec(&self) -> Result<f64>[src]

returns passed time in seconds.

pub fn get_counter(&self) -> Result<i64>[src]

returns internal counter value.

pub fn reset(&mut self) -> Result<()>[src]

resets internal values.

Trait Implementations

impl Send for TickMeter[src]

impl Drop for TickMeter[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]