scripts for timeing average calculation