If you keep looking down, there are two functions testUnOptimizedAvg(), testOptimizedAvg(). These two functions do what you ask.