Advertisement
Guest User

Untitled

a guest
Mar 31st, 2015
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. #include "Sampler.h"
  2.  
  3. const unsigned Size = 1000;
  4.  
  5.  
  6. void TestLoop(int nTimes)
  7. {
  8. static int TestDim[Size];
  9. int tmp;
  10. int iLoop;
  11.  
  12. while (nTimes > 0)
  13. {
  14. nTimes --;
  15.  
  16. iLoop = Size;
  17. while (iLoop > 0)
  18. {
  19. iLoop -- ;
  20. tmp = TestDim[0];
  21. TestDim[0] = TestDim[nTimes];
  22. TestDim[nTimes] = tmp;
  23. }
  24. }
  25. } /* TestLoop */
  26.  
  27.  
  28. void main()
  29. {
  30. SAMPLE;
  31. TestLoop(Size / 10); // 100 * 1000 повторений
  32. SAMPLE;
  33. TestLoop(Size / 5); // 200 * 1000 повторений
  34. SAMPLE;
  35. TestLoop(Size / 2); // 500 * 1000 повторений
  36. SAMPLE;
  37. TestLoop(Size / 1); // 1000* 1000 повторений
  38. SAMPLE;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement