How to measure or monitor the WatchFace battery performance in the simulator?

Hi devs,

I continue to advance in the development of my WatchFace, I am using the onPartialUpdate event successfully to draw the seconds and so on in case of low power mode, etc... At this moment I want to measure the battery performance, if it is within a reasonable consumption or if it is draining the battery more than normal. So far I can only see the WatchFace diagnostics and the memory consumption and I think they are reasonable measurements, but as such the battery consumption, I don't know how to measure it. How can this be measured or monitored in the simulator?

Watchface diagnostics in Always-Active mode:

Memory usage:

  • You can't really see this in the sim, as there you set the battery level and it doesn't change.  

    With what you posted you can make a guess about impact - specifically the first line in watch face diagnostics.

    you are seeing 25164, which translates to 25.164 ms - the last time onPartialUpdate ran.  This is the number you want to keep under an avg of 30ms over a minute.  If you go over that average, onPartialUpdats stops being called.

    The smaller you can get that number, the better for battery.  For a simple digitial watchface, I'm usually in the 9ms-10ms range.

    Also remember this is really only for MIP displays and not AMOLED.

    In general, you can also have a background service, and it's impact on battery can vary based on how often it runs, how long it runs for, and what it does..

    Also the battery on a devices comes into play.  On device A, when running your watch face, you may see a drop of x% per hour. but on device B it's double that.

  • Thank you for the detailed explanation. I appreciate the insights on the impact of onPartialUpdate times and the distinction between MIP and AMOLED displays.

    I will aim to keep the onPartialUpdate times under 30ms and will strive for even lower values to optimize battery life. I also understand the importance of device-specific variations and will take those into account.

    Your suggestion on using background services effectively is very intriguing, however I'm not quite sure on how to use it properly. Where can I find some examples and use cases, for example to render seconds or heart rate?

    Thanks again for your assistance!

  • Backgrounding is a whole different topic.  Just that having a background service can increase battery drain.

    in the app store, if you look at something that can run in the background, you see this:

    • Run in the background when it is not active (potentially affecting battery life)
  • Ok ok, I understand, yes perhaps using a background service is too much for a simple watch face. Thanks again the the quick answer and advices.

    Best regards.
    /Juan

  • What you may want to look at is the battery drain you see on a real watch vs what you see for another watch face.  Native watch faces aren't written in CIQ and that alone could make them perform better than a ciq one. so you may want to compare against another CIQ one.  This isn't a quick test so give it an extended test.

  • Yes, that's exactly what I'm doing, I'm testing it on my own watch, and measuring the performance. So far in my opinion it performs very well, I have compared it with other CIQs that I have and yes, I think it is very good.

    To draw the seconds when in low power mode, I have realized that the most expensive part is the following:

    dc.setClip(131, 102, 18, 80);
    dc.setColor(Graphics.COLOR_TRANSPARENT, Graphics.COLOR_BLACK);
    dc.clear();

    Of those 25 ms, this part alone consumes about 16 ms. Is there any other way to achieve the same thing, or to optimize the code? The larger the area inside the clip, the longer it takes, right?

  • You'll find that how many rows are in the clip region are an impact as the display actually gets updated by row.

    also, if you have multiple clip regions they actually get combined, so it's the top row for the top region, to the bottom row in the bottom region.

    In the case of something like the second hand for an analog face. you see that the impact is largest at 12 and 6 and lowest at 3 and 9 (due to the number of rows)

  • Understood, thanks for the clarification!