Hi all,
i have a rather strange problem. I am writing a program under Lazarus, the program will need to be started when the raspberry boots. When i compile my program and run it, the CPU usage is about 50%, which is acceptable . There is a clock on the screen and it shows the seconds nicely. However, when i try to autostart the same program it gets a very high CPU usage, around 90-100% constantly which makes it laggy.
I have tried different approaches to autostart the program :
1) I created a file in the .config/autostart directory with the needed startup information. Doesnt work
2) I tried to write another small program that autostarts, with a TTimer set to 15 seconds and then execute the main program with a fpsystem('....'); command. That worked, the cpu usage dropped again to 50% during those 15 seconds, but as soon as my program started the CPU usage hit the ceiling again.
3) Then i tried to 'sudo nano .bashr' and added the line to open a script that contained my program executable and also the small boot program . No luck.
I have no clue why autostarting my program would cause it have a high CPU usage, Since when i open the task manager i see that it only uses about 4%. When i boot normally and execute the program from the command line, CPU usage is normal.
Also, the CPU usage i see in task manager is not correct. When i get the 100% usage i only see that my prog uses about 4-5% and task manager 10%, and a very few small ones that use less then 1% each. All in total not even 20% load. How do i get to a full load ?
Anyone has any ideas ? It would be highly appreciated
