Elapsy is a singleton class that calculates the elapsed time from the moment the first instance until the moment one of the possible functions is called.
npm install --save elapsy
In order to use elapsy, you need to instantiate the class when you want to start counting the time. EG right after you start your application
const Elapsy = ;// This will mark the current time for the next callsconst elapsy = ;
When you want to check the execution time, you can use one of the following functions:
Returns the number of the execution time in miliseconds
const elapsy = ;const elapsed = elapsy;console;
Returns a formated string of the execution time in the format hh:mm:ss:ms.
If the elapsed time is more than a day, the number of days is show in the start of the string.
1 day, 12:43:17.385
428 days, 04:58:23.032
const elapsy = ;const formatedElapsed = elapsy;console;
Insert the formated (hh:mm:ss.ms) string of the current elapsed time in the right end of the terminal.
You can pass a chalk color to the method (default is blue) and if you want to show the miliseconds;
const elapsy = ;elapsy;