Move Timer from init to libbase
Test: boot bullhead
Test: new libbase unit tests
Change-Id: Ic398a1daa1fe92c10ea7bc1e6ac3f781cee9a5b5
diff --git a/init/init.cpp b/init/init.cpp
index d23e1a3..bf251ff 100644
--- a/init/init.cpp
+++ b/init/init.cpp
@@ -73,6 +73,7 @@
using android::base::boot_clock;
using android::base::GetProperty;
+using android::base::Timer;
namespace android {
namespace init {
@@ -232,7 +233,7 @@
panic();
}
- property_set("ro.boottime.init.cold_boot_wait", std::to_string(t.duration_ms()));
+ property_set("ro.boottime.init.cold_boot_wait", std::to_string(t.duration().count()));
return 0;
}
@@ -870,7 +871,7 @@
}
// init's first stage can't set properties, so pass the time to the second stage.
- setenv("INIT_SELINUX_TOOK", std::to_string(t.duration_ms()).c_str(), 1);
+ setenv("INIT_SELINUX_TOOK", std::to_string(t.duration().count()).c_str(), 1);
} else {
selinux_init_all_handles();
}