UNPKG

com.phloxui

Version:

PhloxUI Ng2+ Framework

39 lines (38 loc) 1.89 kB
/** * <p style="text-indent: 2em;"> * A <code>ng</code> service handles the <code>UI</code> system clock logic. The <code>UI</code> system clock is mainly responsible for periodically * update the system-wide clock to other components. Using clock provided by <code>this</code> service instead of using <code>setInterval()</code> or * <code>setTimeout()</code> method may be more benefitial in many circumstances. For example, if you have many <code>UI</code> components needed to * be periodically updated itself in background, without <code>this</code> service, you may need to use <code>setTimeout()</code> / <code>setInterval()</code> * method for each component. This leads to having poor <code>application</code>'s performance. In spite of that, you can use the <code>system clock</code> * provided by <code>this</code> service to let all <code>UI</code> components being updated at the same <code>clock tick</code> rate. Furthermore, * <code>this</code> service also provides you a capability to configure its <code>interval</code>. So, you can haste up or slow down system-wide <code>UI</code> * updating rate in a single place. * </p> * * @author shiorin, tee4cute */ export declare class UISystemClock { private currentDateTime; private phloxAppInfo; private timerInterval; private delayTimer; constructor(); private updateTimerInterval(); /** * <p style="text-indent: 1em;"> * Get current <code>system clock</code> datetime. * </p> * * @return A <code>Date</code> object representing current system datetime. */ getCurrentClockDateTime(): Date; /** * <p style="text-indent: 1em;"> * Get current <code>system clock</code> time in milliseconds. * </p> * * @return A number representing current system datetime in milliseconds. */ getCurrentClockTime(): number; }