mirror of
https://github.com/jorgebucaran/fisher
synced 2024-10-09 09:36:53 +02:00
fix: use perl for epoch only on FreeBSD & Darwin; fix #458
This commit is contained in:
parent
7850f78e8a
commit
d7b9cd526d
1 changed files with 9 additions and 8 deletions
|
@ -2,13 +2,14 @@ set -g fisher_version 3.0.3
|
||||||
|
|
||||||
type source >/dev/null; or function source; . $argv; end
|
type source >/dev/null; or function source; . $argv; end
|
||||||
|
|
||||||
if command which perl >/dev/null
|
switch (command uname)
|
||||||
|
case Darwin FreeBSD
|
||||||
function _fisher_now -a elapsed
|
function _fisher_now -a elapsed
|
||||||
command perl -MTime::HiRes -e 'printf("%.0f\n", (Time::HiRes::time() * 1000) - $ARGV[0])' $elapsed
|
command perl -MTime::HiRes -e 'printf("%.0f\n", (Time::HiRes::time() * 1000) - $ARGV[0])' $elapsed
|
||||||
end
|
end
|
||||||
else
|
case \*
|
||||||
function _fisher_now -a elapsed
|
function _fisher_now -a elapsed
|
||||||
command date "+%s%3N" | command awk "{ sub(/3N\$/,\"000\"); print \$0 - 0$elapsed }"
|
command date "+%s%3N" | command awk "{ sub(/3N\$/,\"500\"); print \$0 - 0$elapsed }"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue