A little bit of telemetry goes a long way

def update(self):
        for name, mgr in self.manager_entries:
            start_time = time.ticks_ms()
            mgr.update()
            now = time.ticks_ms()
            mgr.update_time_ms=time.ticks_diff(now,start_time)
            self.status[name] = mgr.get_status()

This is the update loop for the Python version of the Connected Little Boxes software. It works through all the managers and updates them all. It also records how long each manager took to update and stores this value in the manager. I’ve found this to be incredibly valuable when trying to measure performance. When I display the status of the managers I also show the update_time value, which tells me who is slowing things down. When you make something that might be a bit performance sensitive its always worth adding a tiny bit of telemetry to find out what is going on.