Skip to content

Instantly share code, notes, and snippets.

@kenzo0107
Created February 6, 2020 04:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kenzo0107/bc71ff213806f885c936e6d220d998bc to your computer and use it in GitHub Desktop.
Save kenzo0107/bc71ff213806f885c936e6d220d998bc to your computer and use it in GitHub Desktop.
date +%N doesn't work on OS X, but you could use one of ...

Ruby

ruby -e 'puts Time.now.to_f'

Python

python -c 'import time; print time.time()'

Node.js

node -e 'console.log(Date.now())'

PHP

php -r 'echo microtime(TRUE);'

Elixir

DateTime.utc_now() |> DateTime.to_unix(:millisecond)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment