derive_vars_duration function

Derive Duration