/    Sign up×
Community /Pin to ProfileBookmark

Something like time()???

Does anybody know any way of call some function that will alow me to capture the time at a certain point so that I can determine the time a block of code takes to execute? I’ve tried a few methods but none of them seem to work for me. I don’t know what I’m doing wrong.

Thanks,
Douglas

to post a comment
Java

3 Comments(s)

Copy linkTweet thisAlerts:
@WaylanderMay 23.2006 — Calendar.getInstance()

That will get you a full date and time, then just get the minutes and seconds from it.

You dont even really need the time, just save an instance before the block then get a new one and compare them it will give you a precise answer.

Have a look at the calendar object in the API its pretty usefull.

Waylander.
Copy linkTweet thisAlerts:
@DJRobThaManauthorMay 23.2006 — Thanks a lot. This really helped. I actually got my code to work now.

Douglas
Copy linkTweet thisAlerts:
@WaylanderMay 24.2006 — No worries. ?

Waylander.
×

Success!

Help @DJRobThaMan spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.23,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...