Merge "Fix minor time bug in ConsentCallback::getElapsedTimeMs"
diff --git a/cmds/dumpstate/DumpstateInternal.h b/cmds/dumpstate/DumpstateInternal.h
index 10db5d6..c1ec55e 100644
--- a/cmds/dumpstate/DumpstateInternal.h
+++ b/cmds/dumpstate/DumpstateInternal.h
@@ -49,6 +49,7 @@
// TODO: use functions from <chrono> instead
const uint64_t NANOS_PER_SEC = 1000000000;
+const uint64_t NANOS_PER_MILLI = 1000000;
uint64_t Nanotime();
// Switches to non-root user and group.
diff --git a/cmds/dumpstate/dumpstate.cpp b/cmds/dumpstate/dumpstate.cpp
index d705fa8..585a98e 100644
--- a/cmds/dumpstate/dumpstate.cpp
+++ b/cmds/dumpstate/dumpstate.cpp
@@ -660,7 +660,7 @@
}
uint64_t Dumpstate::ConsentCallback::getElapsedTimeMs() const {
- return Nanotime() - start_time_;
+ return (Nanotime() - start_time_) / NANOS_PER_MILLI;
}
void Dumpstate::PrintHeader() const {