Get duration only once

We don’t need to get duration every seconds. (to reduce network load)