Boot to desktop and boot to command line can be chosen using raspi-config. I decided to do a test to see whether my code will execute faster using the command line interface.
How come the raspberry pi execution time calculated is different on the desktop terminal and command line terminal with the command line interface execution showing slower results?
Code execution of my code in the desktop terminal shows 0.004s / 250Hz while in command line interface showing a slower 0.03s / 33Hz execution time
I am using:
At the beginning of the code I use:
deltaTimeInit=getTickCount(); //Open CV function
Then calculate the total execution time at the end of the code loop using the code at the bottom:
The while condition adds delay to keep the deltaTime constant which is used for gyroscope angular velocity integration to obtain angles from quadcopter orientation
while((((float)getTickCount()-deltaTimeInit)/(((float)getTickFrequency())))<0.004){
deltaTime=((float)getTickCount()-deltaTimeInit)/(((float)getTickFrequency()));
cout << "DT = " << deltaTime << endl;
}