mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-10-24 01:18:53 -04:00
Replace C-style clock() with std::chrono::steady_clock to fix timing on Linux
This commit is contained in:
1 parent
5aad79135f
commit
ad4e198aea
4 files changed
+8
-7
No files matched your search
@@ -317,7 +317,7 @@ void RGBController_HyperXKeyboard::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||
|
||||
void RGBController_HyperXKeyboard::DeviceUpdateLEDs()
|
||||
{
|
||||
last_update_time = clock();
|
||||
last_update_time = std::chrono::steady_clock::now();
|
||||
|
||||
if(active_mode == 0)
|
||||
{
|
||||
@@ -363,7 +363,7 @@ void RGBController_HyperXKeyboard::KeepaliveThread()
|
||||
{
|
||||
if(active_mode == 0)
|
||||
{
|
||||
if((clock() - last_update_time) > 50)
|
||||
if((std::chrono::steady_clock::now() - last_update_time) > std::chrono::milliseconds(50))
|
||||
{
|
||||
UpdateLEDs();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user