Advertisement
Guest User

Untitled

a guest
Jun 17th, 2022
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. main()
  4. {
  5. new test = 1;
  6. new text[144];
  7.  
  8. new tickCount = tickcount();
  9.  
  10. if (test == 1)
  11. {}
  12.  
  13. printf("Un if: %i ms", tickcount() - tickCount);
  14.  
  15.  
  16. tickCount = tickcount();
  17.  
  18. for (new i = 0; i < 1000000; i++)
  19. {
  20. if (test == 1)
  21. {}
  22. }
  23.  
  24. printf("1 milion if: %i ms", tickcount() - tickCount);
  25.  
  26.  
  27. tickCount = tickcount();
  28.  
  29. format(text, sizeof text, "d-ul tau este %i", 0);
  30. SendClientMessage(0, -1, text);
  31.  
  32. printf("1 mesaj formatat si trimis: %i ms", tickcount() - tickCount);
  33.  
  34.  
  35. tickCount = tickcount();
  36.  
  37. for (new i = 0; i < 1000000; i++)
  38. {
  39. format(text, sizeof text, "d-ul tau este %i", 0);
  40. SendClientMessage(0, -1, text);
  41. }
  42.  
  43. printf("1 milion mesaje formatate si trimise: %i ms", tickcount() - tickCount);
  44.  
  45.  
  46. tickCount = tickcount();
  47.  
  48. if (test == 1)
  49. {
  50. format(text, sizeof text, "d-ul tau este %i", 0);
  51. SendClientMessage(0, -1, text);
  52. }
  53. else
  54. {
  55. format(text, sizeof text, "d-ul tau este %i", 0);
  56. SendClientMessage(0, -1, text);
  57. }
  58.  
  59.  
  60. printf("Un if cu mesaj formatat&trimis: %i ms", tickcount() - tickCount);
  61.  
  62.  
  63. tickCount = tickcount();
  64.  
  65. for (new i = 0; i < 1000000; i++)
  66. {
  67. if (test == 1)
  68. {
  69. format(text, sizeof text, "d-ul tau este %i", 0);
  70. SendClientMessage(0, -1, text);
  71. }
  72. else
  73. {
  74. format(text, sizeof text, "d-ul tau este %i", 0);
  75. SendClientMessage(0, -1, text);
  76. }
  77. }
  78.  
  79. printf("1 milion if/else cu mesaje formatate&trimise: %i ms", tickcount() - tickCount);
  80.  
  81. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement