// Example program
#include <iostream>
#include <string>
#include <cstdlib> //for random
#include <cmath>  //for pow
#include <chrono>

int main()
{
    size_t seed=rand(); //The testbench will be different everytime, but the testbench will be the same for both paths.
    static const size_t NUM_ITERS=3000000;
    std::chrono::time_point<std::chrono::system_clock> start1, end1,start2,end2;
    uint32_t finhash;
    
    //Pow
    srand(seed);
    finhash=0;
    start1 = std::chrono::system_clock::now();
    for(size_t i=0;i<NUM_ITERS;i++)
    {
        uint32_t n=rand() & 0x1F;
        finhash^=(uint32_t)pow(2,n);   
    }
    end1 = std::chrono::system_clock::now();
    std::chrono::duration<double> elapsed_seconds1 = end1-start1;
    std::cout << "Pow elapsed time: " << elapsed_seconds1.count() << "s.  Hash was " << finhash << std::endl;

    //leftshift
    srand(seed);
    finhash=0;
    start2 = std::chrono::system_clock::now();
    for(size_t i=0;i<NUM_ITERS;i++)
    {
        uint32_t n=rand() & 0x1F;
        finhash^=(uint32_t)(1 << n);   
    }
    end2 = std::chrono::system_clock::now();
    std::chrono::duration<double> elapsed_seconds2 = end2-start2;
    std::cout << "LeftShift elapsed time: " << elapsed_seconds2.count() << "s.  Hash was " << finhash << std::endl;

    return 0;
}