From: David ‘Bombe’ Roden Date: Tue, 18 Sep 2012 06:06:53 +0000 (+0200) Subject: Record and expose startup time. X-Git-Tag: 0.8.3^2~9 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=2748d28c7b7b436a44438b78d98660f28ad7757b;p=Sone.git Record and expose startup time. --- diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 9e1e6c6..c391582 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -77,6 +77,9 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis /** The logger. */ private static final Logger logger = Logging.getLogger(Core.class); + /** The start time. */ + private final long startupTime = System.currentTimeMillis(); + /** The options. */ private final Options options = new Options(); @@ -228,6 +231,15 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis // /** + * Returns the time Sone was started. + * + * @return The startup time (in milliseconds since Jan 1, 1970 UTC) + */ + public long getStartupTime() { + return startupTime; + } + + /** * Sets the configuration to use. This will automatically save the current * configuration to the given configuration. *