mirror of
https://github.com/jorgebucaran/fisher
synced 2024-10-09 09:36:53 +02:00
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:
parent
18bb34f8b1
commit
0b5c6f7a27
1 changed files with 16 additions and 5 deletions
21
fisher.fish
21
fisher.fish
|
@ -1735,12 +1735,23 @@ function __fisher_get_key
|
|||
end
|
||||
|
||||
|
||||
function __fisher_get_epoch_in_ms -a elapsed
|
||||
if test -z "$elapsed"
|
||||
set elapsed 0
|
||||
end
|
||||
switch (command uname)
|
||||
case Darwin
|
||||
function __fisher_get_epoch_in_ms -a elapsed
|
||||
if test -z "$elapsed"
|
||||
set elapsed 0
|
||||
end
|
||||
|
||||
perl -MTime::HiRes -e 'printf("%.0f\n", (Time::HiRes::time() * 1000) - '$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
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue