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

core:time - Added stopwatch procs to return the duration in relevant procedures. Added naming suggestion. #3128

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DragosPopse
Copy link
Contributor

time.stopwatch_stop, time.stopwatch_reset now return the duration they ran for. This is to reduce the need of this common pattern

// BEFORE
time.stopwatch_start(&sw)
duration := time.stopwatch_duration(sw)
// This working differently than _stop, it could be incorrectly placed before the duration get
time.stopwatch_reset(&sw)

// AFTER
time.stopwatch_start(&sw)
duration := time.stopwatch_stop(&sw) // This can also be replaced by a _reset

There is another small naming convention suggestion later down the file. I'm not much attached to that particular change but i figured it wouldn't be bad to unify the procedure names between Duration and Time, plus it's much terser to write when you are working a lot with time.

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

Successfully merging this pull request may close these issues.

None yet

1 participant