Jump to content
Sign in to follow this  

Broken Timer

Recommended Posts


I have a script that runs in the background of a server. It's supposed to go out and look for a marker file on another server and if it finds it, delete it and wait for a specified amount of time. The problem is it's not consistent. I ran it for 3 days with no problems. Now it seems like it's not running at all or it does it at weird hours. The only thing I did that might have effected it is the addition of the tray menu changes. Here's the sample code of the timer below. The $LOG and $DELAY variables come from reading an INI file. The $DELAY variable is normally '60'.

Any help would be appreciated. I'm just not seeing where the issue is.


$timer = TimerInit()

While 1

$msg = TrayGetMsg()


Case $msg = 0


Case $msg = $iniitem

Run ("Notepad.exe Schedulemonitor.ini")

Case $msg = $Logitem

Run ("Notepad.exe " & $LOG)

Case $msg = $aboutitem

Msgbox(64,"About","JDE Scheduler Monitor program"& @LF & "Written by me" & @LF & @CRLF & "Version: "& $version)

Case $msg = $exititem



If TimerDiff($timer) >= $DELAY*60000 Then


$timer = TimerInit()


Sleep(30000) ;Sleep 30 seconds


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.