Revision created by MOE tool push_codebase.
[gae.git] / java / src / main / com / google / appengine / tools / development / Clock.java
blobb1d193f936053a9b0d6f5c86ea7de9faa7f803c9
1 // Copyright 2010 Google Inc. All Rights Reserved.
2 package com.google.appengine.tools.development;
4 /**
5 * Clock abstraction used by all local service implementations.
6 * Allows tests to override 'now'.
8 */
9 public interface Clock {
10 /**
11 * @return current time in milliseconds-since-epoch.
13 long getCurrentTime();
15 /**
16 * The Clock instance used by local services if no override is
17 * provided via {@link ApiProxyLocal#setClock(Clock)}
19 Clock DEFAULT = new Clock() {
20 @Override
21 public long getCurrentTime() {
22 return System.currentTimeMillis();