Helper module to calculate integer time values since the 1970 epoch.
Specifically, the time that has passed since 00:00:00 UTC Jan 1 1970.
Methods
Instance Public methods
milliseconds_since_epoch() Link
Returns approximately the number of milliseconds since the 1970 epoch. This is used for some of the primary key ids. To prevent violation of the uniqueness constraint, sleep is called for 1 millisecond.
Source: show
# File lib/anki_record/helpers/time_helper.rb, line 16 def milliseconds_since_epoch sleep 0.001 DateTime.now.strftime("%Q").to_i end