Use command date +%s%3N in non OS X systems to get the epoch in ms. #252

* Define __fisher_get_epoch_in_ms on fisher.fish load and select
  command date if the user for systems other than OS X.
This commit is contained in:
detailyang 2016-05-05 12:16:23 +08:00 committed by Jorge Bucaran
parent 11d4b278c5
commit 08ea67ddc3

View file

@ -1735,6 +1735,8 @@ function __fisher_get_key
end
switch (command uname)
case Darwin
function __fisher_get_epoch_in_ms -a elapsed
if test -z "$elapsed"
set elapsed 0
@ -1742,6 +1744,15 @@ function __fisher_get_epoch_in_ms -a elapsed
perl -MTime::HiRes -e 'printf("%.0f\n", (Time::HiRes::time() * 1000) - '$elapsed')'
end
case '*'
function __fisher_get_epoch_in_ms -a elapsed
if test -z "$elapsed"
set elapsed 0
end
math (command date +%s%3N) - $elapsed
end
end
function __fisher_parse_column_output