Solved by ptrblck in post #2 
              
              
                Both approaches would calculate the mean only as seen here. The dispatch would be a bit different in case you are checking the stack trace.