collect data on a timer function instead of an delay+counter loop