add run time in version info

This commit is contained in:
heavyrain2012
2021-09-20 21:01:40 +08:00
parent f39fd3abd5
commit 4fd87eb605
2 changed files with 11 additions and 3 deletions
@@ -80,6 +80,7 @@ public class Server {
}
private ServerAcceptor m_acceptor;
private long startTime;
private boolean m_shutdowning = false;
@@ -102,6 +103,10 @@ public class Server {
System.out.println(BANNER);
}
public Server() {
startTime = System.currentTimeMillis();
}
public static void start(String[] args) throws IOException {
instance = new Server();
final IConfig config = defaultConfig();
@@ -513,4 +518,7 @@ public class Server {
public ThreadPoolExecutorWrapper getCallbackScheduler() {
return callbackScheduler;
}
public long getRunTime() {
return (System.currentTimeMillis() - startTime)/1000;
}
}