duration calculation example