Advertisement
Guest User

Untitled

a guest
Mar 13th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. public class PW11 {
  2.  
  3. /**
  4. * @param args the command line arguments
  5. */
  6. public static void main(String[] args) {
  7. int i=0;
  8. long startTime = System.currentTimeMillis();
  9. do{
  10.  
  11.  
  12. Thread ob=new Thread();
  13.  
  14. ob.start();
  15. try {
  16. ob.join();
  17. } catch (InterruptedException ex) {
  18. Logger.getLogger(PW11.class.getName()).log(Level.SEVERE, null, ex);
  19. }
  20. ++i;
  21. }while(i<1000);
  22.  
  23. long endTime = System.currentTimeMillis();
  24. System.out.println("czas: "+(endTime-startTime) );
  25.  
  26. }
  27.  
  28. }
  29.  
  30.  
  31.  
  32. //502ms/1000=0.502ms
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement