@@ -81,9 +81,11 @@ void DisplayWindow::changeDisplay(int msgid){
8181 mode = 0 ;
8282 qint64 fps = 30 ;
8383 QElapsedTimer programExecutionTime;
84+ QElapsedTimer programExecutionTime2;
8485 this ->setFixedSize (QSize (512 +60 , 512 +92 ));
8586 scrollAreaWidgetContents->update ();
8687 programExecutionTime.start ();
88+ programExecutionTime2.start ();
8789 #ifdef Q_OS_WIN32
8890 if (!ConnectNamedPipe (hCreateNamedPipe, NULL )){
8991 if (GetLastError ()!=535 )
@@ -156,10 +158,9 @@ void DisplayWindow::changeDisplay(int msgid){
156158 }
157159 qint64 elapsed_time = programExecutionTime.elapsed ();
158160 if (elapsed_time < 1000 /fps)
159- usleep ((1000 /fps - elapsed_time)*100 );
160- scrollAreaWidgetContents->update ();
161-
161+ usleep ((1000 /fps - elapsed_time)*1000 );
162162 programExecutionTime.start ();
163+ scrollAreaWidgetContents->update ();
163164 }
164165 CloseHandle (hCreateNamedPipe);
165166 #else
@@ -224,9 +225,9 @@ void DisplayWindow::changeDisplay(int msgid){
224225 qint64 elapsed_time = programExecutionTime.elapsed ();
225226 // emit printLog("time: "+QString::number(elapsed_time)+"\n");
226227 if (elapsed_time < 1000 /fps)
227- usleep (1000 /fps - elapsed_time);
228- scrollAreaWidgetContents->update ();
228+ usleep ((1000 /fps - elapsed_time)*1000 );
229229 programExecutionTime.start ();
230+ scrollAreaWidgetContents->update ();
230231 sem_post (sem_consumer);
231232 }
232233 // close sema
@@ -236,6 +237,8 @@ void DisplayWindow::changeDisplay(int msgid){
236237 emit printLog (QString (" shmctl failed\n " ), Qt::red);
237238 }
238239 #endif
240+ qint64 elapsed_time2 = programExecutionTime2.elapsed ();
241+ qint64 ass = elapsed_time2;
239242 loop = false ;
240243 // zoomComboBox->setEditable(false);
241244 emit closeDisplay ();
0 commit comments