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

Histogram startTimer return value in typescript definition incorrect? #617

Open
kevkcc opened this issue Mar 2, 2024 · 0 comments
Open

Comments

@kevkcc
Copy link

kevkcc commented Mar 2, 2024

Hi,

I was wondering if the following line should return number instead of void.

startTimer(): (labels?: LabelValues<T>) => void;

I wanted to start a timer on a specific label and am doing something like this in my code:

const end = histogram.labels({ mylabels }).startTimer();
// some stuff
const seconds = end();

But I was surprised to see that this startTimer in the ts definitions doesn't return number and supposedly returns void. In testing, my code works and it still returns a number so I believe it's just a problem with the ts definition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant