Jump to content

Sleep Count-down Timer


MattNis
 Share

Recommended Posts

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]

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...