Bitcoin
time.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-2019 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.
5 
6 #ifndef BITCOIN_UTIL_TIME_H
7 #define BITCOIN_UTIL_TIME_H
8 
9 #include <stdint.h>
10 #include <string>
11 #include <chrono>
12 
18 
24 int64_t GetSystemTimeInSeconds(); // Like GetTime(), but not mockable
25 
27 void SetMockTime(int64_t nMockTimeIn);
30 
31 void MilliSleep(int64_t n);
32 
34 template <typename T>
35 T GetTime();
36 
41 std::string FormatISO8601DateTime(int64_t nTime);
42 std::string FormatISO8601Date(int64_t nTime);
43 
44 #endif // BITCOIN_UTIL_TIME_H
int64_t GetSystemTimeInSeconds()
Definition: time.cpp:70
int64_t GetTime()
Definition: time.cpp:20
int64_t GetTimeMillis()
Definition: time.cpp:54
int64_t GetMockTime()
Definition: time.cpp:49
signed long long int64_t
Definition: stdint.h:18
std::string FormatISO8601Date(int64_t nTime)
Definition: time.cpp:104
std::string FormatISO8601DateTime(int64_t nTime)
Definition: time.cpp:93
void SetMockTime(int64_t nMockTimeIn)
Definition: time.cpp:44
void MilliSleep(int64_t n)
Definition: time.cpp:75
int64_t GetTimeMicros()
Definition: time.cpp:62