diff options
-rw-r--r-- | src/main.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -316,9 +316,12 @@ int main( int argc, char **argv ) //printf( "Sleeping %d seconds\n ", sn ); if ( rpc_wait( listenFd, sn < 1 ? 1 : sn ) ) { rpc_handle( listenFd ); - // Might have set a new scheduled action, run main loop again if ( nextAction.deadline != oldDeadline ) { + // Might have set a new scheduled action, run main loop again soon CAP_SLEEP( 1 ); + } else { + // Otherwise, still update rather quickly, in case we get polled again + CAP_SLEEP( 5 ); } } // Detect time changes @@ -329,6 +332,7 @@ int main( int argc, char **argv ) // Adjust for clock changes const int diff = ( endWall - startWall ) - ( endMono - startMono ); if ( diff != 0 ) { + printf( "Correcting time by %d seconds\n", diff ); for ( idx = 0; idx < count; ++idx ) { if ( users[idx].display[0] == '\0' ) continue; |