a simple 3 minute program

Blitz3D Forums/Blitz3D Beginners Area/a simple 3 minute program

... Hello my friend wanted me to come up with somthing that makes a noise everytime 3 minutes pass, after 2 hours i came up with somthing, the problem is: its making everything laggy....


I cant figure out why... but it is taking like 77% CPU usage ect, its a small program, any ideas to make it less of a power hogging clock? heres the source:

AppTitle "3minutes"

Graphics 200,100,1,2
SetBuffer BackBuffer()

second=0

minute=0

secondtimer=MilliSecs()

sound = LoadSound("Ungodlysound.wav")

While Not KeyHit(1)
Cls

If MilliSecs() > secondtimer+1000 Then
second=second+1
secondtimer=MilliSecs()
End If

If second>59 Then
minute=minute+1
second=0
End If

If minute=3 Then
minute=0
PlaySound sound
second=0
End If

Text 20,80,"Press ESC to Exit"
Text 80,30,minute+":"+second

  Flip
Wend
End


just get some type of .WAV file and call it: Ungodlysound.wav

put it in the same place as the source code and run. it should play that noise every 3 minutes, but notice how much to laggs stuff down even on my fast computer.


any ideas?