boottime/init: Report ro.boottime.init* properties in milliseconds.
* Nanosecond precision ended up being harder to grok.
* This change modifies the Timer class to have duration_ms instead of
duration_ns.
Bug: 34466121
Test: adb logcat | grep bootstat
Change-Id: Ibd1c27dc3cb29d838a956e342281b2fb98d752a6
diff --git a/bootstat/bootstat.cpp b/bootstat/bootstat.cpp
index 483c01d..a626704 100644
--- a/bootstat/bootstat.cpp
+++ b/bootstat/bootstat.cpp
@@ -212,10 +212,8 @@
BootEventRecordStore* boot_event_store, const char* property) {
std::string value = GetProperty(property);
- int32_t time_in_ns;
- if (android::base::ParseInt(value, &time_in_ns)) {
- static constexpr int32_t kNanosecondsPerMillisecond = 1e6;
- int32_t time_in_ms = static_cast<int32_t>(time_in_ns / kNanosecondsPerMillisecond);
+ int32_t time_in_ms;
+ if (android::base::ParseInt(value, &time_in_ms)) {
boot_event_store->AddBootEventWithValue(property, time_in_ms);
}
}