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

Measurement of execution time of method returns wrong value #2046

Closed
petrlicman opened this issue Sep 6, 2023 · 0 comments · Fixed by #2091
Closed

Measurement of execution time of method returns wrong value #2046

petrlicman opened this issue Sep 6, 2023 · 0 comments · Fixed by #2091
Assignees

Comments

@petrlicman
Copy link
Collaborator

🐛 Describe the bug
Current implementation of time measurement in several methods is wrong, it uses milisecond component and everything else is ignored, it return wrong values always less than 1s.

To Reproduce
Find code there this is used:
DateTime start = DateTime.Now;
double elapsed = DateTime.Now.Subtract(start).Milliseconds / 1000.0;

Expected behavior
Implement some global helper for this, because it is used on several places. Use Stopwatch (prefered) or Ticks at least instead of DateTime.Now because clock can be changed by user, NTP sync ....

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

Successfully merging a pull request may close this issue.

2 participants