Move Timer from init to libbase
Test: boot bullhead
Test: new libbase unit tests
Change-Id: Ic398a1daa1fe92c10ea7bc1e6ac3f781cee9a5b5
diff --git a/init/builtins.cpp b/init/builtins.cpp
index 75a8f19..dfd7b73 100644
--- a/init/builtins.cpp
+++ b/init/builtins.cpp
@@ -39,6 +39,7 @@
#include <sys/wait.h>
#include <unistd.h>
+#include <android-base/chrono_utils.h>
#include <android-base/file.h>
#include <android-base/logging.h>
#include <android-base/parseint.h>
@@ -538,9 +539,9 @@
}
std::string prop_name = "ro.boottime.init.mount_all."s + prop_post_fix;
- Timer t;
+ android::base::Timer t;
int ret = mount_fstab(fstabfile, mount_mode);
- property_set(prop_name, std::to_string(t.duration_ms()));
+ property_set(prop_name, std::to_string(t.duration().count()));
if (import_rc) {
/* Paths of .rc files are specified at the 2nd argument and beyond */