int main(){
long long c = 0;
for(long long i = 0; i < 1000000000; i++){
c++;
}
return 1;
}
package main
func main(){
var f int64 = 0
for i := 0; i < 1000000000; i++{
f++
}
}
#include <iostream>
#include <chrono>
int main(){
auto start_time = std::chrono::steady_clock::now();
long long c = 0;
for(long long i = 0; i < 1000000000; i++){
c+=c xor i;
}
auto end_time = std::chrono::steady_clock::now();
auto elapsed_ns = std::chrono::duration_cast<std::chrono::milliseconds>(end_time - start_time);
std::cout << elapsed_ns.count() << " ms\n";
std::cout << c << std::endl;
return 1;
}
package main
import (
"fmt"
"time"
)
func main(){
var f int64 = 0
var i int64 = 0
start := time.Now()
for i = 0; i < 1000000000; i++{
f+=f ^ i
}
duration := time.Since(start)
fmt.Println(duration)
fmt.Println(f)
}