If you're happy with a resolution of seconds, you can use this one-liner:
t=$SECONDS; (echo a; sleep 1; echo b; sleep 3; echo c; sleep 2) | while read line; do echo $((SECONDS - t)) $line; t=$SECONDS; done
If you are OK with installing node.js, this is exactly what gnomon does: