Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alex:cp$ cat main.cpp
- #include <bits/stdc++.h>
- using namespace std;
- int main() {
- int n = 500000;
- string s = "";
- for (int i = 0; i < n; ++i) {
- s += "a";
- }
- }
- alex:cp$ cat Test.java
- public class Test {
- public static void main(String[] args) {
- int n = 500000;
- String s = "";
- for (int i = 0; i < n; ++i) {
- s += "a";
- }
- }
- }
- alex:cp$ time ./main
- CPU 74%
- tot 0,157
- usr 0,020
- sys 0,096
- alex:cp$ time java Test
- CPU 105%
- tot 6,010
- usr 6,050
- sys 0,277
- alex:cp$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement