Android Question Loop execution time

FrankBerra

Active Member
Licensed User
Longtime User
Is there any suggestion how to log the execution time of a loop?

For example I use the following code
Code:
time1 = DateTime.now

Do while
...
Loop

time2 = DateTime.now
result= time2 - time1
toastmessageshow (result, false)

...but it displays always 0 milliseconds even if the app freezes for a couple of seconds
 
ToastMessageShow() should work. What variable type is time1, time2 and result? They should all be Long. Anything else and you'll get anomalous results.
 
Upvote 0
Back
Top