#!
#
#	polling test for csh
#		(c) 2019	1YEN Toru
#
#
#	2019/08/31	ver.1.00
#
@ niter = 100;
gpio -1 mode 11 input
#
# get start time
set fsec_sta=`clock_gettime`
# polling
@ idx = 0
while ($idx < $niter )
	# read port status
	set val=`gpio -1 read 11`
	@ idx ++
end
# get end time
set fsec_end=`clock_gettime`
#
# show results
awk '\
BEGIN {\
	niter='$niter';\
	fsec_sta='$fsec_sta';\
	fsec_end='$fsec_end';\
	printf ("%f - %f = %f/%d (%f)\n",fsec_end,fsec_sta,\
		fsec_end - fsec_sta,niter, (fsec_end - fsec_sta)/niter);\
}'
