@nicolawealth/time_it
v0.0.2
Published
  and timeIt.async(func, logTime) which behave in the same manner except for timeIt.async(func, logTime) handling asynchronous func arguments. Here func refers to the function you wish to execute and time and the result of func will be returned by timeIt.sync(func, logTime) and timeIt.async(func, logTime).
logTime is a function meant to log the recorded execution time in microseconds and should be of the form: (microseconds) => void. logTime consumes one number, microseconds and does not return anything. A simple logTime implementation could work as follows:
let ms = 0;
const logTime = (microseconds: number): void => {
ms = microseconds;
};Using this logTime function, the execution time in microseconds would be stored in the variable ms.
Testing
Tests can be found in time_it.test.ts located in time_it/src and should be run with sinon, mocha and nyc.
