Developing Apama Applications > Developing Apama Applications in EPL > Defining Event Listeners > Disabling the correlator’s internal clock > Setting the time in the correlator
Setting the time in the correlator
The format of an &SETTIME event is as follows:
&SETTIME(float seconds)
The seconds parameter represents the number of seconds since the epoch, 1st January 1970. For example:
&SETTIME(0) sets the time to Thu Jan 1 00:00:00.0 BST 1970.
&SETTIME(1185874846.3) sets the time to Tue Jul 31 09:40:46.3 BST 2007.
Normally, you do not need to send &SETTIME events. You would just send &TIME events. An &SETTIME event is useful only to avoid the problem pattern described above. The only difference between an &SETTIME event and an &TIME event is that the &SETTIME event causes an intermediate, repeating timer to fire only once while the &TIME event causes intermediate, repeating timers to fire repeatedly. For example, on all wait(0.1) fires ten times for every second in the difference between consecutive &TIME events. However, it fires only once when the correlator receives an &SETTIME event.
If you decide to send an &SETTIME event before an &TIME event, you typically want to send the &SETTIME event only before the first &TIME event. You should not send an &SETTIME event before subsequent &TIME events. Doing so causes a jumpy quality in the behavior of time. There is a warning message in the correlator log if you set a time that moves time backwards.
For information about when you might want to use external time events, see Determining whether to disconnect slow receivers in Deploying and Managing Apama.
Copyright © 2013 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors.