Changeset View
Changeset View
Standalone View
Standalone View
src/utiltime.h
// Copyright (c) 2009-2010 Satoshi Nakamoto | // Copyright (c) 2009-2010 Satoshi Nakamoto | ||||
// Copyright (c) 2009-2015 The Bitcoin Core developers | // Copyright (c) 2009-2015 The Bitcoin Core developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#ifndef BITCOIN_UTILTIME_H | #ifndef BITCOIN_UTILTIME_H | ||||
#define BITCOIN_UTILTIME_H | #define BITCOIN_UTILTIME_H | ||||
#include <cstdint> | #include <cstdint> | ||||
#include <string> | #include <string> | ||||
/** | /** | ||||
* GetTimeMicros() and GetTimeMillis() both return the system time, but in | * GetTimeMicros() and GetTimeMillis() both return the system time, but in | ||||
* different units. GetTime() returns the sytem time in seconds, but also | * different units. GetTime() returns the system time in seconds, but also | ||||
* supports mocktime, where the time can be specified by the user, eg for | * supports mocktime, where the time can be specified by the user, eg for | ||||
* testing (eg with the setmocktime rpc, or -mocktime argument). | * testing (eg with the setmocktime rpc, or -mocktime argument). | ||||
* | * | ||||
* TODO: Rework these functions to be type-safe (so that we don't inadvertently | * TODO: Rework these functions to be type-safe (so that we don't inadvertently | ||||
* compare numbers with different units, or compare a mocktime to system time). | * compare numbers with different units, or compare a mocktime to system time). | ||||
*/ | */ | ||||
int64_t GetTime(); | int64_t GetTime(); | ||||
Show All 19 Lines |