Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 48c808bd authored by Neill Kapron's avatar Neill Kapron Committed by Automerger Merge Worker
Browse files

Merge "libtimeinstate: fix unused variable warning" into main am: 17af1746

parents d4433288 17af1746
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -40,6 +40,9 @@ namespace bpf {
static constexpr uint64_t NSEC_PER_SEC = 1000000000;
static constexpr uint64_t NSEC_PER_YEAR = NSEC_PER_SEC * 60 * 60 * 24 * 365;

// Declare busy loop variable globally to prevent removal during optimization
static long sum __attribute__((used)) = 0;

using std::vector;

class TimeInStateTest : public testing::Test {
@@ -576,7 +579,7 @@ uint64_t timeNanos() {

// Keeps CPU busy with some number crunching
void useCpu() {
    long sum = 0;
    sum = 0;
    for (int i = 0; i < 100000; i++) {
        sum *= i;
    }