# TimerDiff() Need to display in seconds

## Recommended Posts

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 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)```

Simple and effective

Edited by monoceres

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

##### 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 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 on other sites

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

## Create an account

Register a new account

×

• Wiki

• Back

• Git