#!/bin/zsh for i in `yes|head -100` do time1=`date '+%s.%N'` s1=`cat /proc/interrupts` sleep 1 time2=`date '+%s.%N'` s2=`cat /proc/interrupts` t10=`echo "$s1" | awk '$1=="0:"{ print $2}'` t11=`echo "$s1" | awk '$1=="0:"{ print $3}'` t20=`echo "$s2" | awk '$1=="0:"{ print $2}'` t21=`echo "$s2" | awk '$1=="0:"{ print $3}'` d1=`expr $t20 - $t10` d2=`expr $t21 - $t11` echo $d1 + $d2 = `expr $d1 + $d2` `calc $time2 - $time1`s done | cat -n