Added a duration() method to Rest as desired, closing Issue #4