Sign in to follow this  
Followers 0
Swift

TimerDiff() Need to display in seconds

5 posts in this topic

I was thinking StringFormat() or StringTrimLeft() but, StringTrimLeft() Wouldn't be accurate, if you took more than 99 seconds. I just need to display the seconds, and 2 digits after it. So it shows like this:

$Time = TimerInit()
Sleep(15000)
MsgBox(0, "", TimerDiff($Time))

And, I need that to display 15.00 :)

If anyone could help with this topic, thanks. I wish I could learn StringFormat() It's complicated though.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

You won't here's a perfectly good example without it:

$timer=TimerInit()
Sleep(15000)
$seconds=Round(TimerDiff($timer)/1000,2)
If IsInt($seconds) Then $seconds&=".00"
MsgBox(0,"",$seconds)

Simple and effective :)

Edited by monoceres

Broken link? PM me and I'll send you the file!

Share this post


Link to post
Share on other sites

I believe this could too:

$Time = TimerInit()

Sleep(1500)

$Time=TimerDiff($Time)/1000

$Show =StringFormat ("%.2f",$Time)

MsgBox(0, "", $Show)

Share this post


Link to post
Share on other sites

You won't here's a perfectly good example without it:

$timer=TimerInit()
Sleep(15000)
$seconds=Round(TimerDiff($timer)/1000,2)
If IsInt($seconds) Then $seconds&=".00"
MsgBox(0,"",$seconds)oÝ÷ Ù(¦¦W×}ç-÷¿ªê-y&¦zØbî¶W­¶)àJÚâh®f­va{
+«­¢+ØÀÌØíÑ¥µÈõQ¥µÉ%¹¥Ð ¤)M±À ÄÔÀÀÀ¤(ÀÌØíͽ¹ÌôMÑÉ¥¹½ÉµÐ ÅÕ½Ðì¸ÉÅÕ½Ðì°Q¥µÉ¥ ÀÌØíÑ¥µÈ¤¼ÄÀÀÀ¤)5Í ½à À°ÅÕ½ÐìÅÕ½Ðì°ÀÌØíͽ¹Ì¤

:)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Whoa! Thanks Guys! Thanks so much! So Fast, and everything! It works perfectly now! Yes! Thanks!!

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