Skip to content

Commit

Permalink
edit (exec_elapsed_mark): use hours and days to show long time
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Mar 4, 2022
1 parent 9b331c4 commit 699dabb
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion contrib
Submodule contrib updated 1 files
+6 −4 config/execmark.bash
1 change: 1 addition & 0 deletions docs/ChangeLog.md
Expand Up @@ -92,6 +92,7 @@
- prompt: support `bleopt prompt_command_changes_layout` `#D1750` e199bee
- exec: measure execution times `#D1756` 2b28bec
- edit: work around a bash-4.4..5.1 bug of `exit` outputting time to stderr of exit context `#D1765` 3de751e e61dbaa
- edit (`exec_elapsed_mark`): show hours and days `#D1793` 0000000
- util: preserve original traps and restore them on unload `#D1775` `#D1776` `#D1777` 398e404
- progcomp: support `compopt -o ble/no-default` to suppress default completions `#D1789` 0000000
- sabbrev: support options `-r` and `--reset` to remove entries `#D1790` 0000000
Expand Down
5 changes: 5 additions & 0 deletions note.txt
Expand Up @@ -6152,6 +6152,11 @@ bash_tips

2022-03-02

* edit (exec_elapsed_mark): やはり既定で時・日などの分解能の表示にも対応する [#D1793]

長時間ログインしていた後等にはやはり長い時間経過している事がある。
その時に常に分で表示されると分かりにくい。

* canvas: BUG 何故か2回目の char_width_@=auto がちゃんと動いていない気がする [#D1792]
Ref #D1669

Expand Down
14 changes: 11 additions & 3 deletions src/edit.sh
Expand Up @@ -6428,10 +6428,18 @@ function ble-edit/exec:gexec/.epilogue {
ata="${ata}ms"
elif ((ata<1000*1000)); then
ata="${ata::${#ata}-3}.${ata:${#ata}-3}s"
else
elif ((ata/=1000,ata<3600*100)); then # ata [s]
local min
((ata/=1000,min=ata/60,ata%=60))
ata="${min}m${ata}s"
((min=ata/60,ata%=60))
if ((min<100)); then
ata="${min}m${ata}s"
else
ata="$((min/60))h$((min%60))m${ata}s"
fi
else
local hour
((ata/=60,hour=ata/60,ata%=60))
ata="$((hour/24))d$((hour%24))h${ata}m"
fi

# cpu
Expand Down

0 comments on commit 699dabb

Please sign in to comment.