chia-pos2 0.5.0

A library for creating plots, validating proofs of space, farming partial proofs and solving proofs. Using Chia proof of space v2
Documentation
#pragma once

#include <chrono>
#include <iostream>

class Timer {
public:
    bool debugOut = false;

    Timer() : start_time_point(std::chrono::steady_clock::now()) {}

    std::chrono::steady_clock::time_point now() { return std::chrono::steady_clock::now(); }

    void start(std::string msg = "")
    {
        if (debugOut && msg != "") {
            this->message = msg;
            std::cout << message << std::endl;
        }
        start_time_point = now();
    }

    double stop()
    {
        std::chrono::steady_clock::time_point end_time_point = now();
        std::chrono::duration<double, std::milli> duration = end_time_point - start_time_point;
        if (debugOut && message != "") {
            std::cout << message << " took " << duration.count() << "ms" << std::endl;
            message = "";
        }
        return duration.count();
    }

private:
    std::chrono::steady_clock::time_point start_time_point;
    std::string message;
};