Skip to main content

PFunctionTimer

Struct PFunctionTimer 

Source
pub struct PFunctionTimer { /* private fields */ }
Expand description

Timer of a function to make nice benchmark automatically

Implementations§

Source§

impl PFunctionTimer

Source

pub fn new( nb_measure: usize, nb_call_per_measure: usize, vec_nb_element: &Vec<usize>, ) -> Self

Constructor of the PFunctionTimer

§Parameters
  • nb_measure : number of measure for each performance point
  • nb_call_per_measure : number of function calls per measure for each performance point
  • vec_nb_element : vector of all number of element to measure function performance
Source

pub fn set_function_name(&mut self, function_name: &String)

Set the name of the function to be evaluated

§Parameters
  • function_name : name of the function to be evaluated
Source

pub fn add_time_perf(&mut self, time_perf: &PEllapsedTime)

Add a time performance of the function

§Parameters
  • time_perf : time performance of the function
Source

pub fn get_nb_measure(&self) -> usize

Get the number of measure per function perf evaluation

§Returns

Number of measure per function perf evaluation

Source

pub fn get_function_name(&self) -> &String

Get the evaluated function name

§Returns

Evaluated function name

Source

pub fn get_nb_call_per_measure(&self) -> usize

Get the number of function calls per measure per function perf evaluation

§Returns

Number of function calls measure per function perf evaluation

Source

pub fn get_vec_nb_element(&self) -> &Vec<usize>

Get the vector of the number of element to be treated per measure

§Returns

Vector of the number of element to be treated per measure

Source

pub fn eval_perf(&mut self, call_timer_eval_function: &dyn Fn(&mut Self, usize))

Do the full performance evaluation on all vector size

§Parameters
  • call_timer_eval_function : function to call which evaluates performance for a given number of elements
Source

pub fn save_gnuplot(&self, filename: &Path) -> Result<()>

Save performances in a gnuplot compatible file

§Parameters
  • filename : text filename for gnuplot compatibility
§Returns

I/O result

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.