MCPcopy Create free account
hub / github.com/ElementsProject/elements / GetTime

Function GetTime

src/util/time.cpp:26–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24static std::atomic<int64_t> nMockTime(0); //!< For testing
25
26int64_t GetTime()
27{
28 int64_t mocktime = nMockTime.load(std::memory_order_relaxed);
29 if (mocktime) return mocktime;
30
31 time_t now = time(nullptr);
32 assert(now > 0);
33 return now;
34}
35
36bool ChronoSanityCheck()
37{

Callers 15

IsBannedMethod · 0.85
BanMethod · 0.85
SweepBannedMethod · 0.85
GetAdjustedTimeFunction · 0.85
removeForBlockMethod · 0.85
_clearMethod · 0.85
GetMinFeeMethod · 0.85
RelayAddressMethod · 0.85
ProcessHeadersMessageMethod · 0.85
ProcessMessageMethod · 0.85
ProcessNewPackageFunction · 0.85

Calls 3

GetTimeMicrosFunction · 0.85
countMethod · 0.80
loadMethod · 0.45

Tested by 9

BOOST_AUTO_TEST_CASEFunction · 0.68
BOOST_AUTO_TEST_CASEFunction · 0.68
BOOST_AUTO_TEST_CASEFunction · 0.68
TestPackageSelectionMethod · 0.68
BOOST_AUTO_TEST_CASEFunction · 0.68
BOOST_AUTO_TEST_CASEFunction · 0.68
FUZZ_TARGET_INITFunction · 0.68
FillAddrmanFunction · 0.68
mineBlocksMethod · 0.68