testing macroloop run time
Posted: Sun Sep 23, 2018 12:16 pm
playing with timers today i wrote the following code to test my macroloop for my control panel
it can be set as ticks, nanoseconds or milliseconds (just read ticks is fastest)
now i can see on screen exactly how long a button press etc takes (you have to wait for uccnc to display the status message)
my macroloop for my panel takes 0 ticks running if nothing is being pressed showing there are no delays! uccnc is extremely fast!
rem out the status message after testing. //
double time1 = ((DateTime.Now.Ticks)/1); // nanoseconds from tick=/100. ms = /1000;
//exec.AddStatusmessage ("start Time: "+ time1);
// macroloop code here
// at end of code paste this
double time2 = ((DateTime.Now.Ticks)/1); //time in ticks;
double runtime=(time2-time1);
exec.AddStatusmessage ("Elapsed Time ns: "+ runtime );
it can be set as ticks, nanoseconds or milliseconds (just read ticks is fastest)
now i can see on screen exactly how long a button press etc takes (you have to wait for uccnc to display the status message)
my macroloop for my panel takes 0 ticks running if nothing is being pressed showing there are no delays! uccnc is extremely fast!
rem out the status message after testing. //
double time1 = ((DateTime.Now.Ticks)/1); // nanoseconds from tick=/100. ms = /1000;
//exec.AddStatusmessage ("start Time: "+ time1);
// macroloop code here
// at end of code paste this
double time2 = ((DateTime.Now.Ticks)/1); //time in ticks;
double runtime=(time2-time1);
exec.AddStatusmessage ("Elapsed Time ns: "+ runtime );