EdgePi-Cloud / edgepi-python-sdk

Python SDK to control EdgePi, an industrial PC/PLC/IoT device powered by Raspberry Pi CM4

Repository from Github https://github.comEdgePi-Cloud/edgepi-python-sdkRepository from Github https://github.comEdgePi-Cloud/edgepi-python-sdk

Slow LED method calls

iaj2 opened this issue · comments

Test:

edgepi_led = EdgePiLED()
total_time_ns = 0
RANGE = 10**3
for _ in range(RANGE):
    s = time.perf_counter_ns()
    edgepi_led.toggle_led(LEDPins.LED1)
    total_time_ns += time.perf_counter_ns() - s

avg_time_ms = ((total_time_ns/10**6)/RANGE)
print(f'average latency: {avg_time_ms}ms')

Output:
average latency: 2.183056713ms

Note: Using an on-then-off pattern had same results

Sorry Steven ;(