Visible to Intel only — GUID: GUID-EDC9C22B-FD9E-4092-A38F-CF8E60E0AECF
Visible to Intel only — GUID: GUID-EDC9C22B-FD9E-4092-A38F-CF8E60E0AECF
Timer Guidelines
This page provides details on how to use timers in Intel® DAL. For an overview of what timers do, see Timers.
Timer is an object of class com.intel.util.TimerManager.Timer. Timer becomes a "running timer" when an instance of com.intel.util.TimerManager.Timer is created and started by Timer.start(int, byte[], int, int, boolean).
Known Issues
- It is strongly recommended to not use Timer.start(…) inside TimerClient.onTimerTick(…) call back for the same timer instance. For example:
class Applet implements IntelApplet, TimerClient{ Timer m_timer = TimerManager.getInstance().create(this); void invokeCommand(int cmd, byte[] bfr){ m_timer.start(…); } void onTimerTick(byte[] bfr){ m_timer.stop(); m_timer.start(…); //not recomended } }
This not recommended use may lead to UtilOutOfResourcesException during the Timer.start(…), the reason for that is by design of the Java* timers by Native timers sub-system.
- OutOfMemoryError during Timer.start(..)
During Timer.start(…) call, the VM is allocating and releasing memory on the trusted application's heap memory. If the trusted application's heap is full, an OutOfMemoryError will be thrown.
Performance
It is not recommended to start a cyclic timer with a low tick value. Timer works in a resolution of a tick (1 tick = 1 millisecond). No restrictions are present to start a timer with a low tick value. Using (periodic) timers with a low tick count, will result in Intel DAL processing a lot of timer expirations in a short time, and it will affect overall responsiveness of the system. Also, since there's processing overhead of handling such timers, the expiration callbacks are most likely to be called with a considerable delay (relative to the tick-count). E.g.: for a timer scheduled to expire in 10 milliseconds, the callback might be called after 12 milliseconds (20% difference), whereas if the timer was scheduled to expire in 1 second, and the callback is called after 1.002 seconds, the impact is relatively low.