|
@@ -3,6 +3,11 @@
|
|
|
|
|
|
#include <iostream>
|
|
|
#include <chrono>
|
|
|
+unsigned long long nanoTime(){
|
|
|
+ using namespace std;
|
|
|
+ using namespace std::chrono;
|
|
|
+ return duration_cast<nanoseconds>(high_resolution_clock::now().time_since_epoch()).count();
|
|
|
+}
|
|
|
template<typename T>
|
|
|
std::ostream& operator<<(std::ostream& out, std::vector<T> o){
|
|
|
out << "[";
|
|
@@ -22,11 +27,15 @@ std::ostream& operator<< <char>(std::ostream& out, std::vector<char> o){
|
|
|
return out;
|
|
|
}
|
|
|
int main(){
|
|
|
- BigInt a = {2};
|
|
|
- for(int i = 0;i < 16;i++){
|
|
|
+ BigInt a = {1LL << 32};
|
|
|
+ for(int i = 0;i < 12;i++){
|
|
|
+ std::cout << a.toString().size() << " - stellig: " << std::flush;
|
|
|
+ auto t1 = nanoTime();
|
|
|
a = a.mult(a);
|
|
|
+ auto t2 = nanoTime();
|
|
|
+ std::cout << (t2 - t1) << " ns" << std::endl;
|
|
|
}
|
|
|
- std::cout << a.toString() << "\n";
|
|
|
+
|
|
|
}
|
|
|
int mian(){
|
|
|
cppsocket sock("192.168.178.79", 80);
|