pub fn this<T, R, F: FnOnce(T) -> R>(func: F, args: T, name: &'static str) -> (R, Self) {
        let mut measure = Self::start(name);
        let result = func(args);
        measure.stop();
        (result, measure)
    }
/// Measure this function
///
/// Use `Measure::this()` when you have a function that you want to measure.  `this()` will
/// start a new `Measure`, call your function, stop the measure, then return the `Measure`
/// object along with your function's return value.
///
/// If your function takes more than one parameter, you will need to wrap your function in a
/// closure, and wrap the arguments in a tuple.  The same thing applies to methods.  See the
/// tests for more details.
///
/// # Examples
///
/// ```
/// // Call a function with a single argument
/// # use solana_measure::measure::Measure;
/// # fn my_function(fizz: i32) -> i32 { fizz }
/// let (result, measure) = Measure::this(my_function, 42, "my_func");
/// # assert_eq!(result, 42);
/// ```
///
/// ```
/// // Call a function with multiple arguments
/// # use solana_measure::measure::Measure;
/// let (result, measure) = Measure::this(|(arg1, arg2)| std::cmp::min(arg1, arg2), (42, 123), "minimum");
/// # assert_eq!(result, 42);
/// ```
///
/// ```
/// // Call a method
/// # use solana_measure::measure::Measure;
/// # struct Foo { x: i32 }
/// # impl Foo { fn bar(&self, arg: i32) -> i32 { self.x + arg } }
/// # let baz = 8;
/// let foo = Foo { x: 42 };
/// let (result, measure) = Measure::this(|(this, args)| Foo::bar(&this, args), (&foo, baz), "Foo::bar");
/// # assert_eq!(result, 50);
/// ```
Measure this function
Use `Measure::this()` when you have a function that you want to measure.

If your function takes more than one parameter, you will need to wrap your function in a
closure, and wrap the arguments in a tuple.  The same thing applies to methods.  See the
tests for more details.
Measure this function Use ` Measure :: this () ` when you have a function that you want to measure . If your function takes more than one parameter you will need to wrap your function in a closure and wrap the arguments in a tuple . The same thing applies to methods . See the tests for more details .
pub fn this<T, R, F: FnOnce(T) -> R>(func: F, args: T, name: &'static str) -> (R, Self) {
        let mut measure = Self::start(name);
        let result = func(args);
        measure.stop();
        (result, measure)
    }
pub fn this < T , R , F : FnOnce ( T ) -> R > ( func : F , args : T , name : & ' static str ) -> ( R , Self ) { let mut measure = Self :: start ( name ) ; let result = func ( args ) ; measure . stop ( ) ; ( result , measure ) }
Measure this function
Use `Measure::this()` when you have a function that you want to measure.
Measure this function Use ` Measure :: this () ` when you have a function that you want to measure .
func
F
args
T
name
&'static str
examples
```
Call a function with a single argument
` ` ` Call a function with a single argument
use solana_measure::measure::measure;
None
fn my_function(fizz: i32) -> i32 { fizz }
let (result, measure) = Measure::this(my_function, 42, "my_func").
let ( result measure ) = Measure :: this ( my_function 42 " my_func " ) .
assert_eq!(result, 42);


```
Call a function with multiple arguments
` ` ` Call a function with multiple arguments
use solana_measure::measure::measure;
None
assert_eq!(result, 42);


```
Call a method
` ` ` Call a method
use solana_measure::measure::measure;
None
struct foo { x: i32 }
None
impl foo { fn bar(&self, arg: i32) -> i32 { self.x + arg } }
None
let baz = 8;
let foo = Foo { x: 42 };
let (result, measure) = Measure::this(|(this, args)| Foo::bar(&this, args), (&foo, baz), "Foo::bar").
let foo = Foo { x : 42 } ; let ( result measure ) = Measure :: this ( | ( this args ) | Foo :: bar ( &this args ) ( &foo baz ) " Foo :: bar " ) .
assert_eq!(result, 50);
None