Skip to main content

How do you create a timer trigger?

1 reply [Last post]
bedwards
Offline
Joined: 2006-03-06

I want to create a trigger that executes periodically; e.g., it triggers every
60 seconds. How do you write such a trigger in JavaFX? This is to be
used to make a data refresh call. I also want to be able to change the
timeout value in the trigger (say, from 60 seconds to 300 seconds).

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
epatardeccom
Offline
Joined: 2007-11-01

This should be useful...
Best,
Erik

attribute StopWatch.time = 0;
attribute StopWatch.timer = bind [1..10] dur 1000 linear while isRunning continue if true;

trigger on StopWatch.timer = value {
if (isRunning) {
time = System.currentTimeMillis() - startTime;
}
}