Guest User

Untitled

a guest
Dec 10th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. private static List<Packet> packets = new LinkedList<Packet>();
  2.  
  3. public static void main(String[] args) {
  4. for (int i = 0; i < 10000; i++) {
  5. packets.add(new Packet());
  6. }
  7.  
  8. long time = System.nanoTime();
  9.  
  10. for (int i = 0; i < 100000; i++) {
  11. try {
  12. Thread.sleep(50);
  13. } catch (Throwable t) {
  14. }
  15.  
  16. onTick();
  17. }
  18.  
  19. System.out.println(time);
  20. }
  21.  
  22. private static void onTick() {
  23. for (Packet packet : packets) {
  24. packet.getO();
  25. packet.getX();
  26. packet.getY();
  27. packet.getZ();
  28. }
  29. }
Add Comment
Please, Sign In to add comment