Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Unified Diff: src/platform/power_manager/xidle-example.cc

Issue 652147: Add xidle library to power_manager for testing how long the user has been idle (Closed)
Patch Set: Fix issues pointed out by rtc Created 10 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/platform/power_manager/xidle.cc ('k') | src/platform/power_manager/xidle_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/platform/power_manager/xidle-example.cc
diff --git a/src/platform/power_manager/xidle-example.cc b/src/platform/power_manager/xidle-example.cc
new file mode 100644
index 0000000000000000000000000000000000000000..980d3178474db2b620cde01a2aa88a9422b3094a
--- /dev/null
+++ b/src/platform/power_manager/xidle-example.cc
@@ -0,0 +1,18 @@
+// Copyright (c) 2009 The Chromium OS Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <inttypes.h>
+#include <cstdio>
+#include "power_manager/xidle.h"
+
+int main(int argc, char *argv[]) {
+ chromeos::XIdle idle;
+ uint64 idleTime;
+ if (idle.getIdleTime(&idleTime)) {
+ printf("User has been idle for %" PRIu64 " milliseconds\n", idleTime);
+ } else {
+ printf("Cannot calculate idle time\n");
+ }
+ return 0;
+}
« no previous file with comments | « src/platform/power_manager/xidle.cc ('k') | src/platform/power_manager/xidle_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698