001         package com.croftsoft.core.animation.clock;
002    
003         import com.croftsoft.core.animation.Clock;
004         import com.croftsoft.core.math.MathConstants;
005    
006         /*********************************************************************
007         * Uses the system clock to provide the current time in nanoseconds.
008         *
009         * @version
010         *   2003-04-02
011         * @since
012         *   2002-03-09
013         * @author
014         *   <a href="https://www.croftsoft.com/">David Wallace Croft</a>
015         *********************************************************************/
016    
017         public final class  SystemClock
018           implements Clock
019         //////////////////////////////////////////////////////////////////////
020         //////////////////////////////////////////////////////////////////////
021         {
022    
023         public static final SystemClock  INSTANCE = new SystemClock ( );
024    
025         public long  currentTimeNanos ( )
026         //////////////////////////////////////////////////////////////////////
027         {
028           return MathConstants.NANOSECONDS_PER_MILLISECOND
029             * System.currentTimeMillis ( );
030         }
031    
032         private  SystemClock ( ) { }
033    
034         //////////////////////////////////////////////////////////////////////
035         //////////////////////////////////////////////////////////////////////
036         }