Skip to content

Instantly share code, notes, and snippets.

@kibolho
Last active February 24, 2021 18:26
Show Gist options
  • Select an option

  • Save kibolho/abe3bfa9da80656148dcd499b8d2f515 to your computer and use it in GitHub Desktop.

Select an option

Save kibolho/abe3bfa9da80656148dcd499b8d2f515 to your computer and use it in GitHub Desktop.
// timer.start('PROCESS');
// YOUR PROCESS TO MEASURE
// timer.end();
import log from './log';
const logTimer = () => {
let _initiTime: number;
let _title = '';
const start = (title = '') => {
_initiTime = Date.now();
_title = title;
};
const end = () => {
log(`${_title}: ${(Date.now() - _initiTime) / 1000} segundos`, '');
};
return {
start,
end,
};
};
export default logTimer;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment