This file contains hidden or 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
| #!/usr/bin/env bash | |
| # Reads stdin line-by-line and prefixes each line with elapsed time | |
| # since the previous line in MM:SS format. | |
| last_time=$(date +%s) | |
| while IFS= read -r line; do | |
| now=$(date +%s) | |
| elapsed=$((now - last_time)) |