[−][src]Struct opencv::core::TickMeter
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
Auto Trait Implementations
impl !Sync for TickMeter
impl Unpin for TickMeter
impl UnwindSafe for TickMeter
impl RefUnwindSafe for TickMeter
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,