Guest User

Untitled

a guest
Aug 20th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1.  
  2. static int engeneerCount = 5;
  3. static int totalTime = 0;
  4. static int dialogCounts = 0;
  5. static int totalCalculateTime = 0;
  6.  
  7.  
  8. public static void dialog() {
  9. int dialog_time = 0;
  10. int calculate_time = 0;
  11. for (int j = 0; j < 10; j++) {
  12. // инженер думает // работает процессор // вывод на экран
  13. dialog_time += random(5, 10) + 2 + 5;
  14. }
  15. // расчет конструкции
  16. calculate_time = random(20, 30);
  17. dialog_time += calculate_time;
  18. totalCalculateTime += calculate_time;
  19. // вывод на экран
  20. dialog_time += 5;
  21. // анализ данных инженером
  22. dialog_time += random(10, 20);
  23. totalTime += dialog_time;
  24. dialogCounts++;
  25. }
  26.  
  27. public static void maqin(String[] args) {
  28. do {
  29. for (int i = 0; i < engeneerCount; i++) {
  30. dialog();
  31. }
  32. } while (dialogCounts < 100);
  33. System.out.println("Общее время выполнения:" + totalTime / 5);
  34.  
  35.  
  36. }
Add Comment
Please, Sign In to add comment