Use getAndSet() to correctly reset lastSecBytesReadTmp.