pino icon indicating copy to clipboard operation
pino copied to clipboard

Time benchmarks and measuring

Open DzmitryU opened this issue 4 years ago • 1 comments

Hello! I wonder if there is an alternative to the standard console.time + console.timeEnd benchmarking in pino logger?

I expect something like this:

...
logger.time('benchmark1');
...
await reallySlowRequest();
...
logger.timeEnd('benchmark2');

Thanks a lot!

DzmitryU avatar Apr 13 '21 15:04 DzmitryU

Unfortunately that's not implemented. We don't aim to be compatible with console.log - I think that API would be better suited to another module something like:

const pino = require('pino')()
const { time, timeEnd } = require('pino-time')(pino)

mcollina avatar Apr 13 '21 22:04 mcollina

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

github-actions[bot] avatar Mar 20 '23 00:03 github-actions[bot]