#! /bin/sh
# The SPIMS software is covered by a license. The use of the software
# represents acceptance of the terms and conditions in the license.
# ******************************************************************
# Copyright (c) 1989, Swedish Institute of Computer Science
awk '
BEGIN			{ first = 1; ms2sec = 1000; } 
$1 == "ERROR" 		{ print }
$1 == "Results" 	{ runs = $3 } 
$3 == "iterations" 	{ it = $4 }
$1 == "delay" 		{
	dt = $2/ms2sec; dev = $5/ms2sec; 
	if (first)  {
		printf "Average over %d samples: %.3f\n", it, dt/it; 
		  first = 0 
	} else 
		printf "%d samples: average %.3f standard deviation %.3f\n", \
			runs, dt, dev; 
	} 
' $*
