summaryrefslogtreecommitdiff
path: root/contrib/cirrus/timestamp.awk
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/cirrus/timestamp.awk')
-rw-r--r--contrib/cirrus/timestamp.awk20
1 files changed, 20 insertions, 0 deletions
diff --git a/contrib/cirrus/timestamp.awk b/contrib/cirrus/timestamp.awk
new file mode 100644
index 000000000..95b312e51
--- /dev/null
+++ b/contrib/cirrus/timestamp.awk
@@ -0,0 +1,20 @@
+
+
+# This script is intended to be piped into by automation, in order to
+# mark output lines with timing information. For example:
+# /path/to/command |& awk --file timestamp.awk
+
+BEGIN {
+ STARTTIME=systime()
+ printf "[%s] START", strftime("%T")
+ printf " - All [+xxxx] lines that follow are relative to right now.\n"
+}
+
+{
+ printf "[%+05ds] %s\n", systime()-STARTTIME, $0
+}
+
+END {
+ printf "[%s] END", strftime("%T")
+ printf " - [%+05ds] total duration since START\n", systime()-STARTTIME
+}