Code example for ScheduledExecutorService

Methods: scheduleAtFixedRate

0
	public static long currentTimeMillis() { 
		return time.get();
	} 
 
	static { 
		executor.scheduleAtFixedRate(new TimerTicker(), tickUnit, tickUnit,
				TimeUnit.MILLISECONDS);
		Runtime.getRuntime().addShutdownHook(new Thread() {
			@Override 
			public void run() { 
				executor.shutdown();
			} 
		}); 
	} 
}