在 linux 中获得程序开始和程序开始产生输出之间的时间差的最简单方法?

simplest way to get time difference between program start and program start producing output in linux?

我需要知道二进制启动和它在 linux 中第一次输出到标准输出之间的时间差。 有使用 bash 命令行找到它的简单方法吗?

例如,您可以使用 moreutils 包中的 ts 工具:

$ echo hello | ts -i                
00:00:00 hello

$ ( sleep 3 && echo hello ) | ts -i
00:00:03 hello