public Trace withDuration(Double duration) {
        setDuration(duration);
        return this;
    }
<p>
The length of time in seconds between the start time of the root segment and the end time of the last segment
that completed.
</p>

@param duration
       The length of time in seconds between the start time of the root segment and the end time of the last
       segment that completed.
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-xray/src/main/java/com/amazonaws/services/xray/model/Trace.java