diff options
| author | John Newbery <[email protected]> | 2017-05-10 15:49:00 -0400 |
|---|---|---|
| committer | John Newbery <[email protected]> | 2017-05-10 15:49:00 -0400 |
| commit | 761392db3a721728863f773d337d516125ddb23c (patch) | |
| tree | 019b8b3fd6ace4c42c698ff184141696515bc842 /src/utiltime.cpp | |
| parent | Merge #10371: [tests] Clean up addrman_tests.cpp (diff) | |
| download | discoin-761392db3a721728863f773d337d516125ddb23c.tar.xz discoin-761392db3a721728863f773d337d516125ddb23c.zip | |
[logging] log system time and mock time
Diffstat (limited to 'src/utiltime.cpp')
| -rw-r--r-- | src/utiltime.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/utiltime.cpp b/src/utiltime.cpp index 510f540b1..e07069125 100644 --- a/src/utiltime.cpp +++ b/src/utiltime.cpp @@ -31,6 +31,11 @@ void SetMockTime(int64_t nMockTimeIn) nMockTime.store(nMockTimeIn, std::memory_order_relaxed); } +int64_t GetMockTime() +{ + return nMockTime.load(std::memory_order_relaxed); +} + int64_t GetTimeMillis() { int64_t now = (boost::posix_time::microsec_clock::universal_time() - @@ -52,15 +57,6 @@ int64_t GetSystemTimeInSeconds() return GetTimeMicros()/1000000; } -/** Return a time useful for the debug log */ -int64_t GetLogTimeMicros() -{ - int64_t mocktime = nMockTime.load(std::memory_order_relaxed); - if (mocktime) return mocktime*1000000; - - return GetTimeMicros(); -} - void MilliSleep(int64_t n) { |