mirror of
https://github.com/romkatv/powerlevel10k.git
synced 2026-01-29 22:54:40 +01:00
Aligned realtime clock to system clock
This commit is contained in:
parent
8e4738d4c6
commit
4aabc71d54
1 changed files with 7 additions and 1 deletions
|
|
@ -3527,7 +3527,13 @@ _p9k_prompt_time_compute() {
|
||||||
}
|
}
|
||||||
|
|
||||||
_p9k_prompt_time_async() {
|
_p9k_prompt_time_async() {
|
||||||
sleep $_POWERLEVEL9K_EXPERIMENTAL_TIME_REALTIME_INTERVAL || true
|
local I=$_POWERLEVEL9K_EXPERIMENTAL_TIME_REALTIME_INTERVAL
|
||||||
|
|
||||||
|
# No alignment needed in default case
|
||||||
|
(( I <= 1 )) && { sleep 1 || true; return }
|
||||||
|
|
||||||
|
# Sleep until the next aligned boundary: I - (now mod I)
|
||||||
|
sleep $(( I - ($(date +%s) % I) )) || true
|
||||||
}
|
}
|
||||||
|
|
||||||
_p9k_prompt_time_sync() {
|
_p9k_prompt_time_sync() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue