store duration in ms in db