|
|
|
|
|
Re: Epsilon: How to measure a program's execution time [message #1777157 is a reply to message #1769874] |
Sat, 25 November 2017 08:41 |
Banafsheh Azizi Messages: 328 Registered: July 2016 |
Senior Member |
|
|
Hi there,
My tool has interactions with user and I am going to get the pure execution time of the EOL program without the time taken to user response.
I write the below code, However, it is still gives different times in each execution with the same inputs. Would you please help me in this regard?
var startTime = getUserTime();
.
.
.
//end of program
var stopTime = getUserTime();
var elapsedTime : Real = (stopTime - startTime) /1000000;
operation getUserTime() : Integer {
var ManagementFactory = Native("java.lang.management.ManagementFactory");
var bean = ManagementFactory.getThreadMXBean( );
if (bean.isCurrentThreadCpuTimeSupported( ))
return bean.getCurrentThreadUserTime( );
else
return 0;
}
Member of MDSE Research Group
http://mdse.ui.ac.ir
[Updated on: Sat, 25 November 2017 08:45] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03931 seconds