timeit
for debug
Time how long it takes a closure to run.
Signature
> timeit {flags} (command)
Parameters
command
: The closure to run.
Input/output types:
input | output |
---|---|
any | duration |
nothing | duration |
Examples
Time a closure containing one command
> timeit { sleep 500ms }
Time a closure with an input value
> 'A really long string' | timeit { split chars }
Time a closure with an input stream
> open some_file.txt | collect | timeit { split chars }
Time a closure containing a pipeline
> timeit { open some_file.txt | split chars }
Notes
Any pipeline input given to this command is passed to the closure. Note that streaming inputs may affect timing results, and it is recommended to add a collect
command before this if the input is a stream.
This command will bubble up any errors encountered when running the closure. The return pipeline of the closure is collected into a value and then discarded.