github.com/openflowlabs/storage@v1.12.13/contrib/cirrus/timestamp.awk (about)

     1  
     2  
     3  # This script is intended to be piped into by automation, in order to
     4  # mark output lines with timing information.  For example:
     5  #      /path/to/command |& awk --file timestamp.awk
     6  
     7  BEGIN {
     8      STARTTIME=systime()
     9      printf "[%s] START", strftime("%T")
    10      printf " - All [+xxxx] lines that follow are relative to right now.\n"
    11  }
    12  
    13  {
    14      printf "[%+05ds] %s\n", systime()-STARTTIME, $0
    15  }
    16  
    17  END {
    18      printf "[%s] END", strftime("%T")
    19      printf " - [%+05ds] total duration since START\n", systime()-STARTTIME
    20  }