How does one retrieve current time in milliseconds? now()
returns time in seconds.
I know that you can use fc::time_point::now()
from fc/time.hpp
, but that include does not seem to work in contracts.
From Dan Larimer himself when you asked in the EOS Developer telegram
current_time() returns time in microseconds (rounded to block time)
eos/contracts/eosiolib/time.hpp
which has atime_point()
operator in itsblock_timestamp
class. This computes the time by multiplying500
ms by the slot id, which increments each block.