Force a timer to fire

I have a timer in an app that runs every 10 seconds. However I want it to run instantly then every 10 seconds, is there a way to manually force a timer to fire via code?

AFAIK, no.

But you could put the Code in a Method and start the Timer from within this Method.
So you can call the Method, it will be executed instantly and then start the Timer, for example.

Start with the timer period 0ms, then in the first Action event, set period to 10000. It will fire instantly, and subsequent Action will take place every 10 seconds.

Better would probably to put the code executed by the timer in a separate method, then where you actually start the timer, first invoke the method to execute the needed code, then start the timer.

Here is what you posted in the General channel :[quote=327456:@dave duke]I have a timer in an app that runs every 10 seconds. [/quote] Please post in the right channel : Web, and use the correct terminology. WebTimer <> Timer. To change channel to Web, click Controls, and Change Channel.

WebTimer is based on the JavaScript SetInterval, whose period cannot be changed after it is set.

The reply I gave you was for Timer, Desktop of Server side. You can perfectly well use Timer in Web. Drag an object to the page and make it’s super Timer. Server side timer works just like the desktop one. Problem is, the Session object is not available in Action so you will have to use WebSessionContext.

The other possibility is to create a custom control based on WebTimer with a WebContainer, which contains the method and the WebTimer to do what was discussed above.