Hi,
I am using shiVa and eclipse and I have been asked to make a profiling program that would check the time it takes by each function.
Can anyone help me with the basic structure?
I'll need two functions.
onstartTime() and onendTime() and the output should should the difference.
2 Replies - 1219 Views - Last Post: 08 August 2012 - 09:09 AM
#1
Creating a 'profiling' program for the android platfrom
Posted 07 August 2012 - 07:44 PM
Replies To: Creating a 'profiling' program for the android platfrom
#2
Re: Creating a 'profiling' program for the android platfrom
Posted 08 August 2012 - 03:42 AM
System.nanoTime()
http://docs.oracle.c...html#nanoTime()
will return the more precise time you can get mut you will have to call your methods a few thousand times to get a valuable value
That should do it if Android has a System.nanoTime() method
If not you will have to find what ii the Android librray equivalent
http://docs.oracle.c...html#nanoTime()
will return the more precise time you can get mut you will have to call your methods a few thousand times to get a valuable value
That should do it if Android has a System.nanoTime() method
public class Profiling {
private long start;
Profiling() {
reset();
}
long elapsed() {
long end = System.nanoTime();
return end - start;
}
void reset() {
start = System.nanoTime();
}
}
If not you will have to find what ii the Android librray equivalent
This post has been edited by pbl: 08 August 2012 - 03:49 AM
Reason for edit:: Oups.... it is for Android. nanoTimme() might not exist
#3
Re: Creating a 'profiling' program for the android platfrom
Posted 08 August 2012 - 09:09 AM
Moved to Android.
Page 1 of 1
|
|

New Topic/Question
Reply


MultiQuote






|