Advertisement
Norvager

Untitled

Nov 27th, 2018
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. #define _CRT_SECURE_NO_WARNINGS
  2. #include <iostream>
  3. #include <cstdio>
  4. #include <chrono>
  5. #include <ctime>
  6. using namespace std;
  7. using namespace chrono;
  8.  
  9. int main()
  10. {
  11. freopen("in.txt", "r", stdin);
  12. freopen("out.txt", "a+", stdout);
  13. /*for (int i = 0; i < 4915136; ++i)
  14. {
  15. cout << rand() << " ";
  16. }*/
  17. ios_base::sync_with_stdio(false);
  18. cin.tie(NULL);
  19. time_point<system_clock> start, end;
  20. start = system_clock::now();
  21. int a;
  22. for (int i = 0; i < 4915136; ++i)
  23. {
  24. //scanf("%d", &a);
  25. cin >> a;
  26. }
  27. end = system_clock::now();
  28. unsigned long long elapsed_seconds = duration_cast<milliseconds> (end - start).count();
  29. //cout << "scanf:\n";
  30. cout << "cin +:\n";
  31. cout << "Time: " << elapsed_seconds << " milliseconds\n";
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement