setDuration function

Set the duration of dosing or measurement