Index: pkg/analysis_server/lib/src/analysis_server.dart |
diff --git a/pkg/analysis_server/lib/src/analysis_server.dart b/pkg/analysis_server/lib/src/analysis_server.dart |
index 843d50de4bdf9f74c8222fa57ff0dc97be6c83ab..fa718fccb2b69a3414156bfefcddec26274259f5 100644 |
--- a/pkg/analysis_server/lib/src/analysis_server.dart |
+++ b/pkg/analysis_server/lib/src/analysis_server.dart |
@@ -253,6 +253,15 @@ class AnalysisServer { |
ServerPerformance performanceAfterStartup; |
/** |
+ * Return the total time the server's been alive. |
+ */ |
+ Duration get uptime { |
+ DateTime start = new DateTime.fromMillisecondsSinceEpoch( |
+ performanceDuringStartup.startTime); |
+ return new DateTime.now().difference(start); |
+ } |
+ |
+ /** |
* The class into which performance information is currently being recorded. |
* During startup, this will be the same as [performanceDuringStartup] |
* and after startup is complete, this switches to [performanceAfterStartup]. |