Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

Simple pollable timeout functionality to Timer and HResTimer #2203

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

TrevorCash
Copy link
Contributor

No description provided.

refining timer work


more timer work


Fixes to timers


more timer work


removed test code in ui drag


whitespace correct
@Lumak
Copy link
Contributor

Lumak commented Dec 11, 2017

This could be useful, but I'd make some changes.

@weitjong
Copy link
Contributor

I agree with @Lumak.

Don’t forget our contribution checklis: spacing convention, script binding, etc. GetHasTimedOut() sounds weird too, perhaps IsTimedOut() is better?

@Lumak
Copy link
Contributor

Lumak commented Dec 11, 2017

The timeoutTime_ is a constantly moving target, something that you can do without. Instead of storing timeoutTime_, store duration_. Eval of timeout would then be: curTime - startTime_ > duration_ then you don't have to readjust the duration_ in Reset() every time it's called, like what happens with timeoutTime_. And yes, I was going to say the same about IsTimedOut().

@TrevorCash
Copy link
Contributor Author

@Lumak sounds like a great simplification!

@Lumak
Copy link
Contributor

Lumak commented Dec 11, 2017

I find the interfaces some what quirky for me, maybe it's a new way of writing things. But here are the interfaces that I expect:

  • interface to set timeout duration directly
  • being able to do the above, the new constructor, Timer(duration) is not needed
  • not having timeout duration nullified if not passed in GetMSec(), GetUSec(), and Reset(). keeping them as they were would be more ideal and change timeout manually if I need in the 1st bullet item.

@eugeneko
Copy link
Contributor

Agree. Functionality is OK, code style shall be fixed.

@TrevorCash
Copy link
Contributor Author

Is there anything still keeping this from merging in? Just let me know and I'll fix it.

@weitjong
Copy link
Contributor

weitjong commented Jan 8, 2018

Thanks for your PR. We are a little short handed, hopefully we have more free time in the coming weeks to review and merge the backlog.

@github-actions
Copy link

Marking this stale since there has been no activity for 30 days.
It will be closed if there is no activity for another 15 days.

@github-actions github-actions bot added the stale label Mar 22, 2020
@weitjong weitjong added backlog and removed stale labels Mar 22, 2020
@urnenfeld
Copy link

Myself have a subclass of Timer to implement some of the changes proposed in this PR.

Should this PR be simplified or recreated?

We could introduce just a bool Timer::IsTimedOut(unsiged ms) which would return true if ms miliseconds have elapsed since last Reset.

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

Successfully merging this pull request may close these issues.

None yet

5 participants