time()

Creates timed functions which on every successful execution will indicate the amount of time it took to execute.

This function is valid in v2.12.1 to v2.24.3. This function has been downloaded 60 times.

Parameters

{Function} func
Function to wrap and be timed.
{Array|Function} times
If this is an array, on each successful execution of func an object will be added to the end containing the following properties: elapsed (time taken), start (starting time stamp), end (ending time stamp), returnValue, function (a reference to func), this (context object passed to func), and arguments (those passed to func). If this is a function, upon successful execution of func it will be called and passed the aforementioned object.

Returns

{Function}
A wrapped version of func which will take the context and arguments and pass them to func and then return the return value from func. All timing information will be given to times.