Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 165
  • Last Modified:

time function

Currently i am doing an assignment. the title is parallel sorting algorithm. i want to include the time into program so i can know how much time the parallel sorting is use. how can i include it in java? thank you.
0
castle_ckm
Asked:
castle_ckm
  • 2
1 Solution
 
TimYatesCommented:
long then = System.currentTimeMillis() ;

... do processing ...

long now = System.currentTimeMillis() ;
System.out.println( "Took " + ( now - then ) + "ms" ) ;
0
 
CleanupPingCommented:
castle_ckm:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
TimYatesCommented:
Mmmmm...Grade C...

Thanks... :-P
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now