Sign in to follow this  
Followers 0
E1M1

Need some logic help with my timer (count down)

3 posts in this topic

Hi

I am tryng to make program that tells how much time i have left until given time. But it gives something that isnt right... negative time

$4HoursLater = TimerInit() + (4*60*1000); Add 4 hours to current time
While 1
    tooltip($4HoursLater - TimerInit());Shouldnt be negative.
WEnd

edited

Share this post


Link to post
Share on other sites



#3 ·  Posted (edited)

Try this

$Timer = TimerInit()
$4Hours = (4 * 60 * 60 * 1000)

While 1
    ToolTip(Round($4Hours - TimerDiff($Timer), 0))
WEnd

or

#include <Date.au3>
Local $iHours, $iMins, $iSecs, $Timer = TimerInit()
Local $4Hours = (4 * 60 * 60 * 1000)
Local $Time, $oldTime

While 1
    _TicksToTime($4Hours - TimerDiff($Timer), $iHours, $iMins, $iSecs)
    $Time = StringFormat("%02i:%02i:%02i", $iHours, $iMins, $iSecs)
    If $Time <> $oldTime Then ToolTip($Time)
    $oldTime = $Time
    Sleep(10)
WEnd
Edited by Raupi

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0