{"id":1787,"date":"2012-02-03T12:14:59","date_gmt":"2012-02-03T12:14:59","guid":{"rendered":"http:\/\/www.mjtnet.com\/blog\/?p=1787"},"modified":"2012-02-03T16:22:14","modified_gmt":"2012-02-03T16:22:14","slug":"how-long-does-xyz-take","status":"publish","type":"post","link":"https:\/\/www.mjtnet.com\/blog\/2012\/02\/03\/how-long-does-xyz-take\/","title":{"rendered":"How long does xyz take?"},"content":{"rendered":"<p>Need to measure how long a process or a set of commands in your script takes?<\/p>\n<p>We used to have to do this with VBScript&#8217;s Timer function.   As of v13 Macro Scheduler has it&#8217;s own Timer function.<\/p>\n<blockquote><p>Timer>result<\/p>\n<p>Returns the number of milliseconds that have elapsed since the script was started.<\/p><\/blockquote>\n<p>So let&#8217;s say we want to measure how long a script takes to run.  We could use Timer at the top of the script to get the current milliseconds value, then again at the end and take one from the other to get the elapsed duration in milliseconds:<\/p>\n<pre class=\"brush: macroscript\">Timer>startTime\r\n..\r\n.. some code here\r\n..\r\nTimer>endTime\r\nLet>elapsed_seconds={(%endTime%-%startTime%)\/1000}\r\nMessageModal>Seconds Elapsed: %elapsed_seconds%<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Need to measure how long a process or a set of commands in your script takes? We used to have to do this with VBScript&#8217;s Timer function. As of v13 Macro Scheduler has it&#8217;s own Timer function. Timer>result Returns the number of milliseconds that have elapsed since the script was started. So let&#8217;s say we [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[6],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.mjtnet.com\/blog\/wp-json\/wp\/v2\/posts\/1787"}],"collection":[{"href":"https:\/\/www.mjtnet.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mjtnet.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mjtnet.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mjtnet.com\/blog\/wp-json\/wp\/v2\/comments?post=1787"}],"version-history":[{"count":3,"href":"https:\/\/www.mjtnet.com\/blog\/wp-json\/wp\/v2\/posts\/1787\/revisions"}],"predecessor-version":[{"id":1790,"href":"https:\/\/www.mjtnet.com\/blog\/wp-json\/wp\/v2\/posts\/1787\/revisions\/1790"}],"wp:attachment":[{"href":"https:\/\/www.mjtnet.com\/blog\/wp-json\/wp\/v2\/media?parent=1787"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mjtnet.com\/blog\/wp-json\/wp\/v2\/categories?post=1787"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mjtnet.com\/blog\/wp-json\/wp\/v2\/tags?post=1787"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}