Advertisement
Gosunov

Untitled

Sep 13th, 2023
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. alex:cp$ cat main.cpp
  2. #include <bits/stdc++.h>
  3. using namespace std;
  4.  
  5. int main() {
  6. int n = 500000;
  7. string s = "";
  8. for (int i = 0; i < n; ++i) {
  9. s += "a";
  10. }
  11. }
  12. alex:cp$ cat Test.java
  13. public class Test {
  14. public static void main(String[] args) {
  15. int n = 500000;
  16. String s = "";
  17. for (int i = 0; i < n; ++i) {
  18. s += "a";
  19. }
  20. }
  21. }
  22. alex:cp$ time ./main
  23.  
  24. CPU 74%
  25. tot 0,157
  26. usr 0,020
  27. sys 0,096
  28. alex:cp$ time java Test
  29.  
  30. CPU 105%
  31. tot 6,010
  32. usr 6,050
  33. sys 0,277
  34. alex:cp$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement