backport from trunk (rev #9573):
- fixed the calculation of the global average by the _bm_log_timer function.
  Credits go to David Sanders
  Closes patch  #3555236