I have a wxPHP app which refreshes its window every minute.
(It is tailing an Apache log on another machine on the LAN,
and also checking that the WAN can see my server by bouncing a request off a remote web server.)
It seems to be using 100% of 1 of 4 CPU cores, that is, 25% of the CPU load as reported by LxTask,
or 99% of 1 core as reported by "top".
So I created a simple script:
<?php
$frame = new wxFrame(null, wxID_TOP, "Test");
$frame->Maximize();
$frame->Show();
$timer = new wxTimer();
$timer->Start(5000);
$timer->Connect(wxEVT_TIMER, array(wxID_TOP, "refresh"));
wxEntry();
function refresh()
{ $start = microtime(true);
// do nothing
$end = microtime(true);
print ($end - $start)." seconds\n";
}
?>
and that takes 2 - 4 microseconds, and 0% of CPU time, as expected.
So I put that into my app's refresh() function,
and it says it only spends 1.5 seconds inside the function every minute.
It would be OK if I was seeing a 1.5 second burst of activity every minute in LxTask, but I'm not.
Where could all that extra CPU time be going?
Any suggestions?
I have a wxPHP app which refreshes its window every minute.
(It is tailing an Apache log on another machine on the LAN,
and also checking that the WAN can see my server by bouncing a request off a remote web server.)
It seems to be using 100% of 1 of 4 CPU cores, that is, 25% of the CPU load as reported by LxTask,
or 99% of 1 core as reported by "top".
So I created a simple script:
and that takes 2 - 4 microseconds, and 0% of CPU time, as expected.
So I put that into my app's refresh() function,
and it says it only spends 1.5 seconds inside the function every minute.
It would be OK if I was seeing a 1.5 second burst of activity every minute in LxTask, but I'm not.
Where could all that extra CPU time be going?
Any suggestions?