1 // Copyright 2021 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_POWER_METRICS_MACH_TIME_MAC_H_
6 #define COMPONENTS_POWER_METRICS_MACH_TIME_MAC_H_
8 #include <mach/mach_time.h>
11 namespace power_metrics {
13 // Converts |mach_time| to nanoseconds, using the multiplier in |mach_timebase|.
14 uint64_t MachTimeToNs(uint64_t mach_time,
15 const mach_timebase_info_data_t& mach_timebase);
17 // Retrieves the |mach_timebase| to convert |mach_time| obtained on this system
19 mach_timebase_info_data_t GetSystemMachTimeBase();
21 } // namespace power_metrics
23 #endif // COMPONENTS_POWER_METRICS_MACH_TIME_MAC_H_