<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[REXYGEN Community Forum / REXLANG measure duration of code execution]]></title>
	<link rel="self" href="https://www.rexygen.com/oldforum/extern.php?action=feed&amp;tid=425&amp;type=atom"/>
	<link href="http://www.rexygen.com/oldforum/viewtopic.php?id=425"/>
	<updated>2018-04-10T08:46:28Z</updated>
	<generator>FluxBB</generator>
	<id>http://www.rexygen.com/oldforum/viewtopic.php?id=425</id>
	<entry>
		<title type="html"><![CDATA[Re: REXLANG measure duration of code execution]]></title>
		<link rel="alternate" href="http://www.rexygen.com/oldforum/viewtopic.php?pid=1924#p1924"/>
		<content type="html"><![CDATA[<p>Thanks for informations and your help.</p>]]></content>
		<author>
			<name><![CDATA[bodie]]></name>
			<uri>http://www.rexygen.com/oldforum/profile.php?id=127</uri>
		</author>
		<updated>2018-04-10T08:46:28Z</updated>
		<id>http://www.rexygen.com/oldforum/viewtopic.php?pid=1924#p1924</id>
	</entry>
	<entry>
		<title type="html"><![CDATA[Re: REXLANG measure duration of code execution]]></title>
		<link rel="alternate" href="http://www.rexygen.com/oldforum/viewtopic.php?pid=1923#p1923"/>
		<content type="html"><![CDATA[<p>Hello Bodie,</p><p>sorry for troubles with platform inconsistency. You are right - on Linux based systems it works well - however you should be aware that ElapsedTime() returns value in microseconds (Linux) / miliseconds (Windows).</p><p>Many thanks for reporting this bug. We will fix it in next release.</p><p>If I can be of any assistance, let me know.</p><p>Regards, Tomas</p>]]></content>
		<author>
			<name><![CDATA[tomáš čechura]]></name>
			<uri>http://www.rexygen.com/oldforum/profile.php?id=39</uri>
		</author>
		<updated>2018-04-10T08:40:16Z</updated>
		<id>http://www.rexygen.com/oldforum/viewtopic.php?pid=1923#p1923</id>
	</entry>
	<entry>
		<title type="html"><![CDATA[Re: REXLANG measure duration of code execution]]></title>
		<link rel="alternate" href="http://www.rexygen.com/oldforum/viewtopic.php?pid=1922#p1922"/>
		<content type="html"><![CDATA[<p>Hello,<br />the declaration looks like this:</p><div class="codebox"><pre><code>double time1 = 0;</code></pre></div><p>I tried using</p><div class="codebox"><pre><code>double time1 = 0.0;</code></pre></div><p>to see if the type is not cast to long, but it did not help.</p><br /><p>I tried several things and now it is working - the code is OK, but I was running it on localhost on PC. When I download it to RPi3 and run, it is OK.<br />So only for be sure, is there problem running some functions on PC, or probably is it some kind of bug?</p>]]></content>
		<author>
			<name><![CDATA[bodie]]></name>
			<uri>http://www.rexygen.com/oldforum/profile.php?id=127</uri>
		</author>
		<updated>2018-04-10T07:41:17Z</updated>
		<id>http://www.rexygen.com/oldforum/viewtopic.php?pid=1922#p1922</id>
	</entry>
	<entry>
		<title type="html"><![CDATA[Re: REXLANG measure duration of code execution]]></title>
		<link rel="alternate" href="http://www.rexygen.com/oldforum/viewtopic.php?pid=1921#p1921"/>
		<content type="html"><![CDATA[<p>Hi bodie,<br />are you sure the time1 variable is of type double? I guess it&#039;s a long in your declaration.</p><p>Let me know,<br />Jaroslav</p>]]></content>
		<author>
			<name><![CDATA[jaroslav_sobota]]></name>
			<uri>http://www.rexygen.com/oldforum/profile.php?id=3</uri>
		</author>
		<updated>2018-04-09T14:49:38Z</updated>
		<id>http://www.rexygen.com/oldforum/viewtopic.php?pid=1921#p1921</id>
	</entry>
	<entry>
		<title type="html"><![CDATA[Re: REXLANG measure duration of code execution]]></title>
		<link rel="alternate" href="http://www.rexygen.com/oldforum/viewtopic.php?pid=1920#p1920"/>
		<content type="html"><![CDATA[<p>Hello,<br />it is my mistake, I do not change the name of both variables in the post, in the REXLANG code it is OK. Problem is that the time_out is zero. I checked value time_start in Trace (or CurrentTime from each periode, see code below) and it is not changing for several periodes. The periode of task is 2 ms. I do not know what is the resolution of ElapsedTime function?<br />The data type of time1 variable is double.</p><br /><div class="codebox"><pre><code>long init(void)
{		
	time1 = CurrentTime();
			
	return 0;
}

long main(void)
{	
	Trace(11,CurrentTime()-time1);
	
	return 0;
}</code></pre></div><div class="quotebox"><blockquote><div><p>6.4.2018&#160; &#160; 13:07:41.009&#160; &#160; Info&#160; &#160; REXLANG[00289,00029,0011]: 7052<br />6.4.2018&#160; &#160; 13:07:41.011&#160; &#160; Info&#160; &#160; REXLANG[00289,00029,0011]: 7052<br />6.4.2018&#160; &#160; 13:07:41.013&#160; &#160; Info&#160; &#160; REXLANG[00289,00029,0011]: 7052<br />6.4.2018&#160; &#160; 13:07:41.015&#160; &#160; Info&#160; &#160; REXLANG[00289,00029,0011]: 7067<br />6.4.2018&#160; &#160; 13:07:41.017&#160; &#160; Info&#160; &#160; REXLANG[00289,00029,0011]: 7067<br />6.4.2018&#160; &#160; 13:07:41.019&#160; &#160; Info&#160; &#160; REXLANG[00289,00029,0011]: 7067<br />6.4.2018&#160; &#160; 13:07:41.021&#160; &#160; Info&#160; &#160; REXLANG[00289,00029,0011]: 7067<br />6.4.2018&#160; &#160; 13:07:41.023&#160; &#160; Info&#160; &#160; REXLANG[00289,00029,0011]: 7067<br />6.4.2018&#160; &#160; 13:07:41.025&#160; &#160; Info&#160; &#160; REXLANG[00289,00029,0011]: 7067<br />6.4.2018&#160; &#160; 13:07:41.027&#160; &#160; Info&#160; &#160; REXLANG[00289,00029,0011]: 7067<br />6.4.2018&#160; &#160; 13:07:41.029&#160; &#160; Info&#160; &#160; REXLANG[00289,00029,0011]: 7083<br />6.4.2018&#160; &#160; 13:07:41.031&#160; &#160; Info&#160; &#160; REXLANG[00289,00029,0011]: 7083<br />6.4.2018&#160; &#160; 13:07:41.033&#160; &#160; Info&#160; &#160; REXLANG[00289,00029,0011]: 7083<br />6.4.2018&#160; &#160; 13:07:41.035&#160; &#160; Info&#160; &#160; REXLANG[00289,00029,0011]: 7083</p></div></blockquote></div>]]></content>
		<author>
			<name><![CDATA[bodie]]></name>
			<uri>http://www.rexygen.com/oldforum/profile.php?id=127</uri>
		</author>
		<updated>2018-04-06T11:11:43Z</updated>
		<id>http://www.rexygen.com/oldforum/viewtopic.php?pid=1920#p1920</id>
	</entry>
	<entry>
		<title type="html"><![CDATA[Re: REXLANG measure duration of code execution]]></title>
		<link rel="alternate" href="http://www.rexygen.com/oldforum/viewtopic.php?pid=1919#p1919"/>
		<content type="html"><![CDATA[<p>Hello bodie,</p><p>your approach is completely right - I would do it the same way.</p><p>The issue is that you are referencing wrong variable into ElapsedTime() function. It should look like:</p><div class="codebox"><pre><code>long main(void)
{	
	time_start = CurrentTime();

        /*EXECUTED CODE*/
	
	time_out = ElapsedTime(CurrentTime(),time_start);
	
	return 0;
}</code></pre></div><p>Hope it helps.</p><p>Regards, Tomas</p>]]></content>
		<author>
			<name><![CDATA[tomáš čechura]]></name>
			<uri>http://www.rexygen.com/oldforum/profile.php?id=39</uri>
		</author>
		<updated>2018-04-06T10:17:52Z</updated>
		<id>http://www.rexygen.com/oldforum/viewtopic.php?pid=1919#p1919</id>
	</entry>
	<entry>
		<title type="html"><![CDATA[REXLANG measure duration of code execution]]></title>
		<link rel="alternate" href="http://www.rexygen.com/oldforum/viewtopic.php?pid=1918#p1918"/>
		<content type="html"><![CDATA[<p>Hello,<br />ïs it possible somehow to measure, how long the code inside REXLANG is running each periode? I tried using functions CurrentTime and ElapsedTime, but this is not working.</p><p>Thanks for help.</p><p>example:</p><div class="codebox"><pre><code>long main(void)
{	
	time_start = CurrentTime();

        /*EXECUTED CODE*/
	
	time_out = ElapsedTime(CurrentTime(),time1);
	
	return 0;
}</code></pre></div>]]></content>
		<author>
			<name><![CDATA[bodie]]></name>
			<uri>http://www.rexygen.com/oldforum/profile.php?id=127</uri>
		</author>
		<updated>2018-04-06T10:09:14Z</updated>
		<id>http://www.rexygen.com/oldforum/viewtopic.php?pid=1918#p1918</id>
	</entry>
</feed>
