measuring delay from input to output