code: public int getTotalDurationFromFrameDurations(int[] frameDurationMs) {
      int totalMs = 0;
      for (int i = 0; i < frameDurationMs.length; i++) {
        totalMs += frameDurationMs[i];
      }
      return totalMs;
    }
docs: Gets the total duration of an image by summing up the duration of the frames.
  
  @param frameDurationMs the frame duration array
  @return the total duration in milliseconds