Sign in to follow this  
Followers 0
Andraax

_TimeToString()

1 post in this topic

Func _TimeToString($timestamp)
  Local $_time, $_h, $_m, $_s, $_message
  $_time = Round($timestamp / 1000, 0)
  $_h = Int($_time / 3600)
  $_m = Int(($_time - $_h * 3600) / 60)
  $_s = $_time - $_h * 3600 - $_m * 60
  If ($_h > 0) Then
    $_message = StringFormat("%02d:%02d:%02d", $_h, $_m, $_s)
  ElseIf ($_m > 0) Then
    $_message = StringFormat("%02d:%02d", $_m, $_s)
  ElseIf ($_s > 0) Then
    $_message = StringFormat("%02d", $_s)
  Else
    $_message = ""
  EndIf
  Return $_message
EndFunc
oÝ÷ ØLZ^jëh×6$timer = TimerInit()

While 1
   $iTimerDiff = TimerDiff($timer)
   ToolTip(_TimeToString($iTimerDiff),0,0)
WEnd

/Svarten

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