Add unit tests for duration metrics

As a side-effect, move utils::GetMonotonicTime() into the newly added
ClockInterface type.

BUG=None
TEST=Unit tests pass

Change-Id: I972a7e4ba37b63f96348fbeda901697b8ba2fc05
Reviewed-on: https://gerrit.chromium.org/gerrit/48814
Reviewed-by: Chris Sosa <sosa@chromium.org>
Tested-by: David Zeuthen <zeuthen@chromium.org>
Commit-Queue: David Zeuthen <zeuthen@chromium.org>
diff --git a/mock_system_state.cc b/mock_system_state.cc
index b7ed27b..152347a 100644
--- a/mock_system_state.cc
+++ b/mock_system_state.cc
@@ -12,6 +12,7 @@
 MockSystemState::MockSystemState()
   : default_request_params_(this),
     prefs_(&mock_prefs_) {
+  clock_ = &default_clock_;
   request_params_ = &default_request_params_;
   mock_payload_state_.Initialize(this);
   mock_gpio_handler_ = new testing::NiceMock<MockGpioHandler>();