We were finding high CPU usage on macOS when connected to very active serial connections. After running the XCode profiler it pointed to this function.
clock_gettime is available in macOS 10.12 and higher. This change is to use that if it's available. If they are targeting a lower macOS minimum version check it at runtime, otherwise do it at compile time.
We were finding high CPU usage on macOS when connected to very active serial connections. After running the XCode profiler it pointed to this function.
clock_gettime is available in macOS 10.12 and higher. This change is to use that if it's available. If they are targeting a lower macOS minimum version check it at runtime, otherwise do it at compile time.
CPU usage was reduced to a more acceptable level.