Developing Apama Applications > Developing Apama Applications in Java > The Concept of Time in the Correlator > Externally generating time events > About &SETTIME events
About &SETTIME events
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 sequence 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.
For information about when you might want to use external time events, see Deploying and Managing Apama, Determining whether to disable the correlator’s internal clock.
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.