Calculate Task Duration in Different Units

[ ]

Calculating Durations The Task class offers provides the getDuration() method for calculating task duration in different units. This method takes TimeUnitType as the input argument and returns the duration as a double value.

The following piece of code shows how to use this method to retrieve a task’s duration in different units: minute, day, hour, week and month.