Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Time benchmarks and measuring #1011

Closed
DzmitryU opened this issue Apr 13, 2021 · 2 comments
Closed

Time benchmarks and measuring #1011

DzmitryU opened this issue Apr 13, 2021 · 2 comments

Comments

@DzmitryU
Copy link

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!

@mcollina
Copy link
Member

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)

@github-actions
Copy link

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 github-actions bot locked as resolved and limited conversation to collaborators Mar 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants