Howdy folks...
I'm having a difficult time trying to get a procedure to run once every 15 seconds and then wait for another 15 seconds to run again and have not been able to find a reliable solution....any help would be appreciated. So far I've been doing it along these lines....
////Premain
function preMain( )
{
setPriceStudy( true );
setColorPriceBars(true);
var today = new Date();
gcheckSeconds = today.getSeconds() + 15;
}
///Main
if(today.getSeconds() >= gcheckSeconds)
{
call procedure here
gcheckSeconds = today.getSeconds() + 15;
if(gcheckSeconds > 60){
gcheckSeconds = 15;
}
}
the procedure is sometimes called 2, 4, 7...maybe 15 times before it gets reset to wait 15 seconds before running again. I believe the problem to be because the script is running on ticks and not seconds, per se. Any help would be much appreciated....
Thanks
Chris
I'm having a difficult time trying to get a procedure to run once every 15 seconds and then wait for another 15 seconds to run again and have not been able to find a reliable solution....any help would be appreciated. So far I've been doing it along these lines....
////Premain
function preMain( )
{
setPriceStudy( true );
setColorPriceBars(true);
var today = new Date();
gcheckSeconds = today.getSeconds() + 15;
}
///Main
if(today.getSeconds() >= gcheckSeconds)
{
call procedure here
gcheckSeconds = today.getSeconds() + 15;
if(gcheckSeconds > 60){
gcheckSeconds = 15;
}
}
the procedure is sometimes called 2, 4, 7...maybe 15 times before it gets reset to wait 15 seconds before running again. I believe the problem to be because the script is running on ticks and not seconds, per se. Any help would be much appreciated....
Thanks
Chris
Comment