While loop in the 'run' method

Jump to navigation Jump to search
Revision as of 5 November 2012 at 00:40.
This is the thread's initial revision.

While loop in the 'run' method

I'm unclear as to when the while loop in the run method starts, so I added a debug command there:

while(true) {
	setDebugProperty("startingWhile", String.format("heading: %.1f° at time %d.", getHeading(),  getTime()));
	ahead(200);
	// ...
}

But to my surprise, this doesn't get displayed until after the ahead and all the following commands are executed, which I would assume should be the beginning of the second iteration. Is there something that prevents these debug properties from being displayed immediately?

To Wombi: Das ist der Fluch der guten Tat. Ich hoffe, Du bereust nicht, meine Frage beantwortet zu haben.

    Astacus01:40, 5 November 2012