[email protected] | 0f24e53e | 2012-10-29 01:04:09 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "base/sys_info.h" |
| 6 | |
[email protected] | 8f9a3a5 | 2013-06-28 15:14:18 | [diff] [blame] | 7 | #include "base/time/time.h" |
[email protected] | 0f24e53e | 2012-10-29 01:04:09 | [diff] [blame] | 8 | |
| 9 | namespace base { |
| 10 | |
| 11 | // static |
| 12 | int64 SysInfo::Uptime() { |
| 13 | // This code relies on an implementation detail of TimeTicks::Now() - that |
| 14 | // its return value happens to coincide with the system uptime value in |
| 15 | // microseconds, on Win/Mac/iOS/Linux/ChromeOS and Android. |
| 16 | int64 uptime_in_microseconds = TimeTicks::Now().ToInternalValue(); |
| 17 | return uptime_in_microseconds / 1000; |
| 18 | } |
| 19 | |
| 20 | } // namespace base |