foo
measure is now called in a loop instead of by callbacks