Jump to content
Sign in to follow this  

Timer Question - RESOLVED

Recommended Posts



This is going to be a stupid question but I hope someone can help.

I have a timer in my script which logs the time in seconds it took for the script to complete. In the middle of my script i use a sleep command of 5 seconds. I would like to subtract the 5 seconds from the total time before I write the final results. Any ideas would be appreciated.

Here is my existing code:


sleep(5000)  <------   I want to subtract this 5 seconds from the timer before I wright the results to the text file

$handle = Fileopen("c:\logs\times.txt",1)         ; Open the target file
FileWriteline($handle,Round(TimerDiff($timer)/1000,1))              ; Append text to the target file
FileClose($handle)                     ; Close target file
Edited by Kasteel

Share this post

Link to post
Share on other sites

I often get it wrong, so I needed to check it. Just added an alternative to the above post. I miscounted the brackets, but it's now correct. :blink:

Edited by czardas

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.