-
Notifications
You must be signed in to change notification settings - Fork 169
Added a continuous timer that updates during sorting #182
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think start_time
and time_taken
need to be globals.
They are relevant only for DisplayBox
, why not add them as class or instance variables?
There are several options for how to implement this.
For example, you can set start_time
when starting a new sort and update time_taken
when calling the update
method.
You can also save only start_time
and directly do something like:
self.text = str(time() - start_time)[:6] + ' seconds'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure sure DisplayBox
is a good name, all boxes display something.
Looking at the other names TextBox
, SlideBox
, DropdownBox
, ...
Maybe TimeBox
or something like that would be better.
Changes
Why (resolves #169 and #170)
How
main.py
to update display.timeBox and display.time_taken if the display wasn't pausedTesting
Screenshots
Screen.Recording.2023年12月07日.at.11.33.40.PM.mov