How do I get the total duration of a multisport activity?

Info.elapsedTime  and timerTime  only seems to return the duration of the current leg. I would like to have the total duration 

  • IMHO elapsedTime is what you want. Why would Garmin add 2 fields with the same meaning? Though I agree that it's not clear from the documentation what's the difference between them.

  • Info.elapsedTime  and timerTime  only seems to return the duration of the current leg. I would like to have the total duration 
    IMHO elapsedTime is what you want. Why would Garmin add 2 fields with the same meaning? Though I agree that it's not clear from the documentation what's the difference between them.

    I think you're missing the point. OP is not claiming that they think elapsedTime and timerTime are the same thing (clearly they're not *), they're saying that those members refer to the current multisport leg, not the entire multisport activity. They want stats for the entire multisport activity, not the individual legs of the activity.

    (*) Clearly elapsedTime is the same as the native "Elapsed Time" field, which is the total activity (**) time including pauses, while timerTime is the same as the native "Timer" field, which is the total activity (**) time excluding pauses. I agree that the documentation could be better, but that's not the issue here.

    (**) in this context, for the purpose of multisport activities, "activity" = "multisport leg", apparently. Not too different than how Strava treats every leg of a Garmin multisport activity as a different activity.

  • TL;DR I don't think CIQ datafields are multisport-aware at all, but you can probably simulate multisport awareness to a limited degree by just trying to detect when your datafield is started within a short period of time after it was last stopped. (In this context I mean application start/stop.)

    For further context, I always assumed that CIQ data fields treat each multisport leg as a separate activity (and they go through the entire app lifecycle for each leg), but I haven't tested this much, and I don't know of any documentation around this stuff.

    IOW, if you have a multisport activity like Swim / Bike / Run, any CIQ datafield that's added to all 3 of those activities will be run 3 times, and each time will appear to be a completely self-contained activity as far as the datafield is concerned.

    I see that someone released a "multisport distance" field in the store. It only works when the field is added to each activity within the multisport activity, and it doesn't count transitions. I assume there's some trickery where it saves the total distance when it stops, and if it's started again within a short period of time, it will load the previously saved distance and use that as a starting point for the total "multisport distance". (Meaning it would work with consecutive regular activities as well, not just literal multisport legs.)

    apps.garmin.com/.../15aa1886-47cc-42b3-9ed3-15cc407815c9

    I might actually test this out when I have a chance.

  • Just double checked, and even the native "Timer" and "Elapsed Time" fields only refer to the current multisport leg (which is what I thought.) So it's not too crazy that the CIQ fields which correspond to those native fields are only for the current leg, too.

    Ofc there's a native "Multisport Time" field which can be used on custom data pages but unfortunately it's not exposed in the CIQ API. I don't think there's a native "Multisport Elapsed Time" field tho.

  • OK, I missed the "multisport" part Slight smile

    So I don't know if there's a CIQ solution to this. A possible "end-user" solution is (if we're talking about a normal activity, not an app) is to add (built-in) the Elapsed TIme data filed to the layout. I found that when I regularly did multi-sport activities.

  • Idk how it works on your watch, but on my FR955, the native Timer and Elapsed Time fields only seem to apply to the current multisport leg, as I said above. They both restart from 0 when you switch legs. Pretty sure this is how it worked on older watches like 935, as well.

    Are you sure you're not thinking of the Multisport Time field (which is timer time / time excluding pauses as opposed to elapsed time / time including pauses)? Besides, when you do a multisport activity, the total (multisport) time is already part of a dedicated multisport page, which has last leg time and total (multisport) time on my watch.

    So when the end user does a multisport activity, they already have 2 solutions for "multisport timer time", one of which is automatically provided by the watch. But they don't appear to have any solutions for "multisport elapsed time".

    Is it really possible that different watches have different implementations of the native Elapsed Time field? That would suck.

    (It's not that I don't believe you. I don't do multisport activities irl, but in my testing, elapsed time has never applied to the entire multisport activity.)

    So I don't know if there's a CIQ solution to this.

    Like I said above, someone apparently implemented a "multisport distance" field which has to be added to each individual activity in the multisport activity and doesn't count transitions. I can only speculate that it works by saving the total distance at the end of an activity and loading the previously saved distance if the next activity is started shortly after the previous one.

    Something similar could be done for timer time and elapsed time, although it wouldn't count transitions. (Well, akshually, "multisport elapsed time" could count transitions, depending on how it was implemented. By the nature of the "elapsed time" metric, a CIQ hack for "multisport elapsed time" could be more accurate than any hack for "multisport timer time". All you have to do is record the start time of the first leg and display the difference between the current time and the start time.)

  • TL;DR a hypothetical "CIQ multisport stats data field" could work like this:

    1) on app stop, save app start time, app stop time, and various metrics of interest: multisport distance, multisport leg number (initialized to 0), multisport timer time, start time of multisport leg 0. (If this is leg 0, then multisport distance = activity distance and multisport timer time = activity timer time.)

    2) on app start, if app was "recently" (*) stopped, consider this run of the app to be the next leg of an ongoing multisport activity. Load all the metrics saved from the previous run

    3) on app stop, go to step 1)

    My educated guess is this is similar to how the CIQ multisport distance field works.

    (* exactly how "recent" is recent enough is an exercise for the implementer.)

  • OK, I checked it. I added all the fields I could find that seem to be relevant under the Timer and the Workout fields category to the Other activity. Then I started a run, stopped it for ONE minute, then continued the run for a few more seconds, and then I switched to Other activity. And here's the screen:

    the 33 - 34 seconds (another good question why they differ, but that's another issue) displays the time I spent in Other. The 1:14 total time I spent in Run + Other. However I also spent more than 60 seconds when the Run was stopped, and that minute is "missing".

    So there's no built in field in fr965 that includes the time "outside" of the activities (aka stopped)

  • Yeah, let's see if anyone can come up with a better algorithm for #2 (to differentiate between 1st leg of an activity and 2nd leg of a multisport activity)

  • Yeah so again, that "Total Time" (for multisport) field that you see is the Multisport Time field, *not* the Elapsed Time field. We appear to be in violent agreement.

    So to recap:

    - (native) Timer Time = time excluding pauses for current activity / multisport leg (same as CIQ ActivityInfo.timerTime)

    - (native) Elapsed Time = time including pauses for current activity / multisport leg (same as CIQ ActivityInfo.elapsedTime)

    - (native) Multisport Time = time excluding pauses for entire multisport activity (not available in CIQ.)

    "Elapsed Multisport Time" is not available natively or in CIQ.

    Pretty annoying that "Multisport Time" is named that way in the field selection UI, but the data field label itself says Total Time. I kinda get why (probably bc "Total Time" is shorter than "Multisport Time"), but it's annoying.