I guess that this is not an option because of the case that the calculation of the needed statistics takes not always the same time nad I am afraid tht using sleep() would after a couple of time periods skip a meassurement.