| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 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/process/process_info.h" |
| 6 |
| 7 #include <magenta/syscalls.h> |
| 8 |
| 9 #include "base/time/time.h" |
| 10 |
| 11 namespace base { |
| 12 |
| 13 // static |
| 14 const Time CurrentProcessInfo::CreationTime() { |
| 15 #if 0 // TODO(fuchsia): This requires a newer drop of the Fuchsia SDK. |
| 16 mx_info_thread_stats_t thread_stats; |
| 17 if (mx_object_get_info(mx_thread_self(), MX_INFO_THREAD_STATS, &thread_stats, |
| 18 sizeof(thread_stats), nullptr, nullptr) != NO_ERROR) { |
| 19 return Time(); |
| 20 } |
| 21 Time current_time = Time::Now(); |
| 22 TimeDelta total_runtime = TimeDelta::FromMicroseconds( |
| 23 thread_stats.total_runtime / base::Time::kNanosecondsPerMicrosecond); |
| 24 return Time(current_time - total_runtime); |
| 25 #else |
| 26 return Time(); |
| 27 #endif |
| 28 } |
| 29 |
| 30 } // namespace base |
| OLD | NEW |