Sign in to follow this  
Followers 0
MattNis

Sleep Count-down Timer

2 posts in this topic

#1 ·  Posted (edited)

Sometimes usefull if you use a very long sleep command and want to know how soon it will be over

$time = time in seconds (not milliseconds)

Version 1

Opt("TrayIconDebug",1)

_sleep(500)

func _sleep($time)

    for $k = 1 to $time
  TrayTip("clear","", 0);
  TrayTip("",$time - $k, 1);
  Sleep(1000);
    next
  
endfunc

Version 2

Opt("TrayIconDebug",1)
HotKeySet("!z", "_timerDisplay")

_sleep(500)

func _sleep($time)
      Global $timer = $time
      Global $Begin = TimerStart()
      Sleep($timer*1000)
endfunc

func _timerDisplay()
      TrayTip("clear","",0)
      TrayTip("",Round(((1000*$timer)-TimerStop($Begin))/1000), 1)
endfunc
Edited by MattNis

[quote]I was busy waiting all night for the Columbus Day Bunny to come down my chimney and light fireworks in my pumpkin.There's so much wrong with that.Oh, I'm sorry, i forgot you were Jewish.[/quote]

Share this post


Link to post
Share on other sites



Nice :whistle:

:iamstupid:

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