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

Measure the running time of a thread #178

Open
hitriyvalenok opened this issue May 14, 2023 · 1 comment
Open

Measure the running time of a thread #178

hitriyvalenok opened this issue May 14, 2023 · 1 comment
Labels

Comments

@hitriyvalenok
Copy link

hitriyvalenok commented May 14, 2023

Hello there!

  1. Does the package have an analog of map method but for thread beginning? I want to measure the time the thread spends but cannot find a way to catch the beginning of the thread run.
  2. Which differences between methods map and finally? It looks slightly more logical to use finally, but it doesn't pass the task object in the callback. Could you please clarify this moment?

Thanks!

@kelunik
Copy link
Member

kelunik commented May 14, 2023

Hey @hitriyvalenok,

  1. There's no such equivalent. map is a method on the result placeholder. I guess you're looking to measure the time spent in the worker without counting the queue time in the parent? Otherwise you can just measure from before submitting the task to the worker.
  2. map is only called if there's no exception, finally is always called, like code running after a throwing statement in a try/catch/finally block.

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

No branches or pull requests

2 participants