#include <boost/heap/fibonacci_heap.hpp>
#include <boost/heap/priority_queue.hpp>
#include <boost/heap/binomial_heap.hpp>
#include <boost/heap/d_ary_heap.hpp>
#include <queue>
#include <chrono>
#include <iostream>
using namespace std;
using namespace std::chrono;
int main(){
std::priority_queue<int> pq;
std::priority_queue<int, std::deque<int> > pqd;
boost::heap::priority_queue<int> bpq;
boost::heap::fibonacci_heap<int> bfh;
boost::heap::binomial_heap<int> bbh;
const int NUM_ITER = 1000000;
cout << "NUM_ITER:" << NUM_ITER << "\n";
auto ts = system_clock::now();
for(int i=0; i<NUM_ITER; i++){
pq.push(rand());
}
for(int i=0; i<NUM_ITER; i++){
pq.pop();
}
double ts1 = duration_cast<nanoseconds>(system_clock::now() - ts).count();
cout << "std::priority_queue: " << ts1/(double)NUM_ITER << " ns\n";
ts = system_clock::now();
for(int i=0; i<NUM_ITER; i++){
pqd.push(rand());
}
for(int i=0; i<NUM_ITER; i++){
pqd.pop();
}
ts1 = duration_cast<nanoseconds>(system_clock::now() - ts).count();
cout << "std::priority_queue<int, std::deque<int> >: " << ts1/(double)NUM_ITER << " ns\n";
ts = system_clock::now();
for(int i=0; i<NUM_ITER; i++){
bpq.push(rand());
}
for(int i=0; i<NUM_ITER; i++){
bpq.pop();
}
ts1 = duration_cast<nanoseconds>(system_clock::now() - ts).count();
cout << "boost::heap::priority_queue: " << ts1/(double)NUM_ITER << " ns\n";
ts = system_clock::now();
for(int i=0; i<NUM_ITER; i++){
bfh.push(rand());
}
for(int i=0; i<NUM_ITER; i++){
bfh.pop();
}
ts1 = duration_cast<nanoseconds>(system_clock::now() - ts).count();
cout << "boost::heap::fibonacci_heap: " << ts1/(double)NUM_ITER << " ns\n";
ts = system_clock::now();
for(int i=0; i<NUM_ITER; i++){
bbh.push(rand());
}
for(int i=0; i<NUM_ITER; i++){
bbh.pop();
}
ts1 = duration_cast<nanoseconds>(system_clock::now() - ts).count();
cout << "boost::heap::binomial_heap: " << ts1/(double)NUM_ITER << " ns\n";
}