The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

average

    Run a callback a number of times and return the average time.
    If no iterations are given, the default of 10 will be used.
    If no digits are given, the default of 12 will be used.

    Returns the average time.

benchmark

    Create a new benchmark object.

microseconds

    Set the number of digits to 8.
    Returns the object.

milliseconds

    Set the number of digits to 4.
    Returns the object.

nanoseconds

    Set the number of digits to 12.
    Returns the object.

print

    Print the elapsed time for a timer.

seconds

    Set the number of digits to 0.
    Returns the object.

series

    Run a callback a number of times and return the elapsed times.
    If no iterations are given, the default of 10 will be used.
    If no digits are given, the default of 12 will be used.

    Returns an array ref of elapsed times.

start

    Start a timer.
    If no name is given, the timer will be named 'elapsed'.
    If no digits are given, the default of 4 will be used.

    Returns the object.

stop

    Stop a timer.
    If no name is given, the last timer started will be stopped.
    If no digits are given, the default of 5 will be used.
    If output is set, the elapsed time will be printed to STDOUT.

    Returns the elapsed time.