我正在考慮從 zsh 切換到 fish,但是在此之前,我想比較提示加載的速度。我有一個 ZSH 函式,它的時間是提示加載所需時間的 10 倍。
timeshell() {
shell=${1-$SHELL}
for i in $(seq 1 10); do /usr/bin/time $shell -i -c exit; done
}
我正在努力將相同的代碼實作為符合魚的東西。例如以下:
time for i in 1 2 3 4 5 6 7 8 9 10; fish; end
將實際加載fish shell 提示符,取消命令。
有什么想法嗎?謝謝你。
uj5u.com熱心網友回復:
不確定我是否完全理解。你是這個意思嗎?
function timeshell
set shell $SHELL
for i in (seq 1 10); /usr/bin/time $shell -i -c exit; end
end
uj5u.com熱心網友回復:
在 fish 中,您可以對函式進行計時:
> time fish_prompt
Executed in 6.71 ms fish external
usr time 1.72 ms 0.00 ms 1.72 ms
sys time 6.07 ms 6.07 ms 0.00 ms
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/439532.html
