-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdot_bashrc
More file actions
19 lines (14 loc) · 737 Bytes
/
Copy pathdot_bashrc
File metadata and controls
19 lines (14 loc) · 737 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# Do not edit this file. Put files in the dir below.
# Note: bashrc refers to something that runs in each and every new shell.
for _config_bashrc_d in "$HOME"/.config/bashrc.d/*.sh; do
_epoch_start=${EPOCHREALTIME:-0}
# shellcheck disable=SC1090
source "$_config_bashrc_d"
declare -i _duration_threshold_ms=250
_epoch_diff=$(bc --expression="${EPOCHREALTIME:-0} - $_epoch_start")
_over_threshold=$(bc --expression="($_epoch_diff * 1000) > $_duration_threshold_ms" --mathlib)
if ((_over_threshold)); then
printf '%80s took %3.3fs (over %dms threshold)\n' "$_config_bashrc_d" "$_epoch_diff" "$_duration_threshold_ms"
fi
unset _config_bashrc_d _duration_threshold_ms _epoch_diff _epoch_start _over_threshold
done