I solved it like this:
private View.OnClickListener buttonListener = new
View.OnClickListener() {
@Override
public void onClick(View v) {
end = SystemClock.uptimeMillis();
Log.d("SimpleApp", "onClick: "+v.getHandler());
Log.d("SimpleApp", "time start: " + start);
Log.d("SimpleApp", "time end: " + end);
Log.d("SimpleApp", "time diff: " + (end-start));
}
};
@Override
public boolean dispatchTouchEvent (MotionEvent ev) {
start = ev.getEventTime();
return super.dispatchTouchEvent(ev);
}
getEventTime() will return the time (since boot I think) when the
event was created. This way it should work.
If you have other suggestions, please let me know.
On Oct 5, 10:28 am, Samuel Skånberg <[email protected]> wrote:
> Hello,
>
> I'm doing my thesis work on resource management on android and I want
> to be able to measure the "responsiveness" of an application to figure
> out if the application get enough resources and is scheduled often
> enough.
>
> So what I want is a way to insert timestamps on events, e.g. button
> clicks, when they are created and when they are consumed. This way I
> can get the "responsiveness" of the application. But I have a hard
> time of finding exactly where the events are created and also
> consumed.
>
> In Handler.java there is the handleCallback(Message message) method
> which I can insert the end time stamp. I tried to add a long variable
> in the Message class and that worked well (had to rebuild the api
> though). So my problem is to find the place where the button click is
> generated and where the message that corresponds to that event is
> being created so I can add a time stamp.
>
> I also welcome other suggestions on how to measure the
> "responsiveness" of an application or other way to measure how well an
> application performs.
>
> Kind regards,
> Samuel
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en