mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-07-19 00:48:09 -07:00
api lock: test results
This commit is contained in:
+25
-1
@@ -1,6 +1,30 @@
|
||||
#pragma once
|
||||
#include <furi/furi.h>
|
||||
|
||||
/*
|
||||
Testing 10000 api calls
|
||||
|
||||
No lock
|
||||
Time diff: 445269.218750 us
|
||||
Time per call: 44.526920 us
|
||||
|
||||
furi_thread_flags
|
||||
Time diff: 430279.875000 us // lol wtf? smaller than no lock?
|
||||
Time per call: 43.027988 us // I tested it many times, it's always smaller
|
||||
|
||||
FuriEventFlag
|
||||
Time diff: 831523.625000 us
|
||||
Time per call: 83.152359 us
|
||||
|
||||
FuriSemaphore
|
||||
Time diff: 999807.125000 us
|
||||
Time per call: 99.980713 us
|
||||
|
||||
FuriMutex
|
||||
Time diff: 1071417.500000 us
|
||||
Time per call: 107.141747 us
|
||||
*/
|
||||
|
||||
typedef FuriEventFlag* FuriApiLock;
|
||||
|
||||
#define API_LOCK_EVENT (1U << 0)
|
||||
@@ -16,4 +40,4 @@ typedef FuriEventFlag* FuriApiLock;
|
||||
|
||||
#define api_lock_wait_unlock_and_free(_lock) \
|
||||
api_lock_wait_unlock(_lock); \
|
||||
api_lock_free(_lock);
|
||||
api_lock_free(_lock);
|
||||
Reference in New Issue
Block a user