-
-
Save dolmen/5788893 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
export TESTS=${TESTS:-1000000} | |
# liberated from liquidprompt | |
local ti_sgr0="$( { tput sgr0 || tput me ; } 2>/dev/null )" | |
local ti_bold="$( { tput bold || tput md ; } 2>/dev/null )" | |
if tput setaf >/dev/null 2>&1 ; then | |
ti_setaf () { tput setaf "$1" ; } | |
elif tput AF >/dev/null 2>&1 ; then | |
# *BSD | |
ti_setaf () { tput AF "$1" ; } | |
else | |
[[ "$_LP_SHELL" = bash ]] && echo "liquidprompt: terminal $TERM not supported" >&2 | |
ti_setaf () { : ; } | |
fi | |
_LP_OPEN_ESC='%{';_LP_CLOSE_ESC='%}' | |
LP_COLORMAP_9="${_LP_OPEN_ESC}${ti_bold}$(ti_setaf 3 ; tput setab 1)${_LP_CLOSE_ESC}" | |
LP_COLORMAP_A='%{%B%F{yellow}%K{red}%}' | |
echo "Test 9" | |
typeset -i i | |
i=0 | |
time ( while (( $i < $TESTS )); do | |
print -Pn "$LP_COLORMAP_9" | |
let i++ | |
done ) | |
echo | |
echo "Test A" | |
i=0 | |
time ( while (( $i < $TESTS )); do | |
print -Pn "$LP_COLORMAP_A" | |
let i++ | |
done ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment