testing macroloop run time

This is where you talk about Macros, show examples of your macro scripting and SHARE handy segments of script code as examples.

testing macroloop run time

Postby Battwell » 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 );
Uc300eth on router and mill.
UK uccnc powered machine sales. https://cncrouter.uk/atc-cnc-routers.htm
Automateanything/duzzit cnc/mercury cnc
Battwell
 
Posts: 819
Joined: Sun Sep 25, 2016 7:39 pm
Location: South Wales. Uk

Return to Macros

Who is online

Users browsing this forum: No registered users and 7 guests