Bitcoin
Functions
time.h File Reference
#include <stdint.h>
#include <string>
#include <chrono>

Go to the source code of this file.

Functions

int64_t GetTime ()
 
int64_t GetTimeMillis ()
 
int64_t GetTimeMicros ()
 
int64_t GetSystemTimeInSeconds ()
 
void SetMockTime (int64_t nMockTimeIn)
 
int64_t GetMockTime ()
 
void MilliSleep (int64_t n)
 
std::string FormatISO8601DateTime (int64_t nTime)
 
std::string FormatISO8601Date (int64_t nTime)
 

Function Documentation

◆ FormatISO8601Date()

std::string FormatISO8601Date ( int64_t  nTime)

◆ FormatISO8601DateTime()

std::string FormatISO8601DateTime ( int64_t  nTime)

ISO 8601 formatting is preferred. Use the FormatISO8601{DateTime,Date} helper functions if possible.

◆ GetMockTime()

int64_t GetMockTime ( )

For testing

◆ GetSystemTimeInSeconds()

int64_t GetSystemTimeInSeconds ( )

Returns the system time (not mockable)

◆ GetTime()

int64_t GetTime ( )

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

Return system time (or mocked time, if set)

◆ GetTimeMicros()

int64_t GetTimeMicros ( )

Returns the system time (not mockable)

◆ GetTimeMillis()

int64_t GetTimeMillis ( )

Returns the system time (not mockable)

◆ MilliSleep()

void MilliSleep ( int64_t  n)

Boost's sleep_for was uninterruptible when backed by nanosleep from 1.50 until fixed in 1.52. Use the deprecated sleep method for the broken case. See: https://svn.boost.org/trac/boost/ticket/7238

◆ SetMockTime()

void SetMockTime ( int64_t  nMockTimeIn)

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