Hello. I've been using the Harbour compiler for some time to maintain a little program I wrote starting back in 1990 (using Clipper).
A feature I recently added using the hb_IdleAdd to add a function that, if there has been no activity for ten seconds, closes all the file handles (recording in an array all the details of the open files). It then waits for a keypress, and when there is one, it reopens all the files.
I do this so if I sleep my notebook computer w/o closing my app, I can then wake my laptop and continue using my app w/o any errors due to network files no longer being accessible (due to the sleep).
The problem was, using the Harbour compiler, once I had closed the files and was waiting for a keypress, the CPU usage went up a lot (10-12%, enough to cause the CPU fan to speed-up). Nothing I did to rewrite the part of the code for waiting for the keypress could resolve this, everything used as much CPU as inkey.
So I downloaded xHarbour and was able to get the CPU usage down to 0% by calling SecondsSleep(). I double-checked by compiling with the latest Harbour (not xHarbour) and SecondsSleep() compiles but still high CPU utilization.
So basically xHarbour for the win.
The only thing that I don't like about xXarbour is that I seem to need a make file for everything I compile. Even helloworld.prg, I'd need a make file. With Harbour, I had a batch file (bld.bat) and could just type "bld helloworld" and it compiled any simple little code I was testing.
Is there any chance of doing this with xHarbour?
Thank you everyone it is wonderful to see all this help and support continuing.