Skip to content

Instantly share code, notes, and snippets.

View JoshuaKyleLambert's full-sized avatar

Josh JoshuaKyleLambert

View GitHub Profile
@JoshuaKyleLambert
JoshuaKyleLambert / two_second_dirty_bit.cpp
Created August 2, 2025 23:48
Two Second Dirty Bit Timer
#include "two_second_dirty_bit.h"
#include <chrono>
#include <iostream>
#include <shared_mutex>
bool two_second_dirty_bit::is_set() const
{
std::shared_lock lock(mutex_); // Use shared lock to allow concurrent reads
return dirty_bit_.load(); // Returns true if the timer is running
}