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
11
fisher.fish
11
fisher.fish
|
@ -1735,6 +1735,8 @@ function __fisher_get_key
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
switch (command uname)
|
||||||
|
case Darwin
|
||||||
function __fisher_get_epoch_in_ms -a elapsed
|
function __fisher_get_epoch_in_ms -a elapsed
|
||||||
if test -z "$elapsed"
|
if test -z "$elapsed"
|
||||||
set elapsed 0
|
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')'
|
perl -MTime::HiRes -e 'printf("%.0f\n", (Time::HiRes::time() * 1000) - '$elapsed')'
|
||||||
end
|
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
|
function __fisher_parse_column_output
|
||||||
|
|
Loading…
Reference in a new issue