mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-04-04 22:24:12 -04:00
Replace C-style clock() with std::chrono::steady_clock to fix timing on Linux
This commit is contained in:
@@ -65,7 +65,7 @@ void CorsairLightingNodeController::KeepaliveThread()
|
||||
{
|
||||
while(1)
|
||||
{
|
||||
if((clock() - last_commit_time) > 5000)
|
||||
if((std::chrono::steady_clock::now() - last_commit_time) > std::chrono::seconds(5))
|
||||
{
|
||||
SendCommit();
|
||||
}
|
||||
@@ -271,7 +271,7 @@ void CorsairLightingNodeController::SendCommit()
|
||||
/*-----------------------------------------------------*\
|
||||
| Update last commit time |
|
||||
\*-----------------------------------------------------*/
|
||||
last_commit_time = clock();
|
||||
last_commit_time = std::chrono::steady_clock::now();
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up Commit packet |
|
||||
|
||||
Reference in New Issue
Block a user