Dash Core Source Documentation (0.16.0.1)

Find detailed information regarding the Dash Core source code.

utiltime.cpp File Reference
#include <tinyformat.h>
#include <utiltime.h>
#include <atomic>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/thread.hpp>
#include <chrono>
+ Include dependency graph for utiltime.cpp:

Go to the source code of this file.

Functions

static std::atomic< int64_t > nMockTime (0)
 For unit testing. More...
 
int64_t GetTime ()
 Return system time (or mocked time, if set) More...
 
void SetMockTime (int64_t nMockTimeIn)
 For testing. More...
 
int64_t GetMockTime ()
 For testing. More...
 
int64_t GetTimeMillis ()
 Returns the system time (not mockable) More...
 
int64_t GetTimeMicros ()
 Returns the system time (not mockable) More...
 
int64_t GetSystemTimeInSeconds ()
 Returns the system time (not mockable) More...
 
void MilliSleep (int64_t n)
 
std::string DateTimeStrFormat (const char *pszFormat, int64_t nTime)
 

Function Documentation

◆ DateTimeStrFormat()

std::string DateTimeStrFormat ( const char *  pszFormat,
int64_t  nTime 
)

◆ GetMockTime()

int64_t GetMockTime ( )

For testing.

Definition at line 51 of file utiltime.cpp.

References nMockTime().

Referenced by LogTimestampStr().

◆ GetSystemTimeInSeconds()

int64_t GetSystemTimeInSeconds ( )

◆ GetTime()

T GetTime ( )

Return system time (or mocked time, if set)

DEPRECATED Use either GetSystemTimeInSeconds (not mockable) or GetTime<T> (mockable)

Definition at line 22 of file utiltime.cpp.

References nMockTime().

Referenced by CTxMemPool::_clear(), AcceptToMemoryPool(), CNetFulfilledRequestManager::AddFulfilledRequest(), AddOrphanTx(), AppInitMain(), CWallet::AutoBackupWallet(), CConnman::Ban(), BenchTimeDeprecated(), PeerLogicValidation::BlockConnected(), CMasternodeSync::BumpAssetLastTime(), CNetFulfilledRequestManager::CheckAndRemove(), PeerLogicValidation::CheckForStaleTipAndEvictPeers(), CPrivateSendClientSession::CheckTimeout(), CKeyPool::CKeyPool(), convertSeed6(), CWalletKey::CWalletKey(), dumpwallet(), CWallet::GenerateNewKey(), GetAdjustedTime(), getblocktemplate(), CConnman::GetMaxOutboundTimeLeftInCycle(), CTxMemPool::GetMinFee(), CWallet::GetOldestKeyPoolTime(), CNetFulfilledRequestManager::HasFulfilledRequest(), CPrivateSendServer::HasTimedOut(), PeerLogicValidation::InitializeNode(), CConnman::IsBanned(), IsCurrentForFeeEstimation(), CPendingDsaRequest::IsExpired(), IsInitialBlockDownload(), CPrivateSendClientSession::JoinExistingQueue(), LimitMempoolSize(), LimitOrphanTxSize(), ListObjects(), LoadMempool(), CGovernanceManager::MasternodeRateUpdate(), MaybeCompactWalletDB(), MasternodeList::on_checkBoxMyMasternodesOnly_stateChanged(), MasternodeList::on_filterLineEditDIP3_textChanged(), BerkeleyEnvironment::Open(), OverviewPage::privateSendStatus(), ProcessHeadersMessage(), ProcessMessage(), CPrivateSendClientSession::ProcessPendingDsaRequest(), CPrivateSendClientSession::ProcessPoolStateUpdate(), CMasternodeSync::ProcessTick(), RandAddSeedPerfmon(), CConnman::RecordBytesSent(), BerkeleyBatch::Recover(), RelayAddress(), CTxMemPool::removeForBlock(), CGovernanceManager::RequestGovernanceObjectVotes(), CWallet::ResendWalletTransactions(), resendwallettransactions(), CMasternodeSync::Reset(), CWallet::ScanForWalletTransactions(), CPrivateSendClientSession::SendDenominate(), PeerLogicValidation::SendMessages(), CConnman::SetMaxOutboundTimeframe(), CPrivateSendBaseSession::SetNull(), CPrivateSendServer::SetState(), CPrivateSendClientSession::SignFinalTransaction(), CPrivateSendClientSession::StartNewQueue(), CConnman::SweepBanned(), CMasternodeSync::SwitchToNextAsset(), CConnman::ThreadDNSAddressSeed(), CConnman::ThreadOpenConnections(), MasternodeList::updateDIP3List(), MasternodeList::updateDIP3ListScheduled(), BitcoinGUI::updateHeadersSyncProgressLabel(), uptime(), PaymentServer::verifyExpired(), and walletpassphrase().

◆ GetTimeMicros()

◆ GetTimeMillis()

◆ MilliSleep()

◆ nMockTime()

static std::atomic<int64_t> nMockTime ( )
static

For unit testing.

Referenced by GetMockTime(), GetTime(), and SetMockTime().

◆ SetMockTime()

void SetMockTime ( int64_t  nMockTimeIn)

For testing.

Set e.g. with the setmocktime rpc, or -mocktime argument

Definition at line 46 of file utiltime.cpp.

References nMockTime().

Referenced by AddTx(), AppInitParameterInteraction(), BenchTimeMock(), BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), and setmocktime().

Released under the MIT license