Merge #10114: [tests] sync_with_ping should assert that ping hasn't timed out
[bitcoinplatinum.git] / src / utiltime.h
blobcc3290c63157097887b5c3978e7644afd08555f4
1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2015 The Bitcoin Core developers
3 // Distributed under the MIT software license, see the accompanying
4 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
6 #ifndef BITCOIN_UTILTIME_H
7 #define BITCOIN_UTILTIME_H
9 #include <stdint.h>
10 #include <string>
12 /**
13 * GetTimeMicros() and GetTimeMillis() both return the system time, but in
14 * different units. GetTime() returns the system time in seconds, but also
15 * supports mocktime, where the time can be specified by the user, eg for
16 * testing (eg with the setmocktime rpc, or -mocktime argument).
18 * TODO: Rework these functions to be type-safe (so that we don't inadvertently
19 * compare numbers with different units, or compare a mocktime to system time).
22 int64_t GetTime();
23 int64_t GetTimeMillis();
24 int64_t GetTimeMicros();
25 int64_t GetSystemTimeInSeconds(); // Like GetTime(), but not mockable
26 int64_t GetLogTimeMicros();
27 void SetMockTime(int64_t nMockTimeIn);
28 void MilliSleep(int64_t n);
30 std::string DateTimeStrFormat(const char* pszFormat, int64_t nTime);
32 #endif // BITCOIN_UTILTIME_H