23 ms·
A bit fancier than my awk version awk -W interactive 'BEGIN { t = systime(); } { u=systime(); if (u - t > 1) { printf("= %s %ds =========\n",strftime("%T"),
by overhead4075 2y ago
A bit fancier than my awk version
awk -W interactive 'BEGIN { t = systime(); } { u=systime(); if (u - t > 1) { printf("= %s %ds =========\n",strftime("%T"), u - t); }; print $0; t = u; }'
Or if you want to clear the screen too
awk -W interactive 'BEGIN { t = systime(); } { u=systime(); if (u - t > 1) { printf("\033[2J\033[H= %s %ds =========\n",strftime("%T"), u - t); }; print $0; t = u; }'
- Poiesis 2y agoJust to maybe save someone a couple of seconds of time: the '-W interactive' bit is a mawk-specific option (-W is for implementation-specific options). Not 100% certain but it looks like the gawk default does something similar so no additional option is needed, I think.