diff options
| author | 2020-01-28 01:48:23 +0000 | |
|---|---|---|
| committer | 2020-01-28 01:48:23 +0000 | |
| commit | 73061b92fe797bc74e6576f976fe32476fcba41e (patch) | |
| tree | 773e1978749297a95bd800235e6213ef0953c86c | |
| parent | 35a5e3b93d710d02ca0e8382b5f9164754e74e5d (diff) | |
| parent | c17ca50b172562e3f6c8ea3e68b69dc7be1ae021 (diff) | |
Merge "Fix minor time bug in ConsentCallback::getElapsedTimeMs" am: 3ed7588987 am: c17ca50b17
Change-Id: I8f700fdbc1fd32e8bd6109a491725dcb4bd693c4
| -rw-r--r-- | cmds/dumpstate/DumpstateInternal.h | 1 | ||||
| -rw-r--r-- | cmds/dumpstate/dumpstate.cpp | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/cmds/dumpstate/DumpstateInternal.h b/cmds/dumpstate/DumpstateInternal.h index 10db5d65e3..c1ec55ee61 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 d705fa80b5..585a98e0be 100644 --- a/cmds/dumpstate/dumpstate.cpp +++ b/cmds/dumpstate/dumpstate.cpp @@ -660,7 +660,7 @@ UserConsentResult Dumpstate::ConsentCallback::getResult() { } uint64_t Dumpstate::ConsentCallback::getElapsedTimeMs() const { - return Nanotime() - start_time_; + return (Nanotime() - start_time_) / NANOS_PER_MILLI; } void Dumpstate::PrintHeader() const { |