Important: Please read the Qt Code of Conduct -

What to do about timers when computer goes to sleep mode..?

  • For example now its 00:20, i want at 00:22 a function to be called.
    so i use seconds until 00:22 which will output 120..

    what about if in that period of time the user sleeps(suspends) the computer?
    i can only guess that the timer will pause. So what should i do? check every second the current time of the system? Is there something specific for this problem?

  • Noone? :/

  • Moderators

    Please be patient; it has been less than 24 hours since you posted your question.

    Anyway, try it. Does the timer pause?

    If it pauses, one solution is to record the actual time when you want the function to be called. Then, get the timer to fire periodically (say... every 5 seconds?) to check if the time has arrived yet. If it has, call your function.

Log in to reply