Sha256: a74c959c101476e939eb5a844c9d43a9c3949fe6e486056c279c54475765ce6d

Contents?: true

Size: 800 Bytes

Versions: 17

Compression:

Stored size: 800 Bytes

Contents

#ifndef ENTERPRISE_SCRIPT_SERVICE_TIMER_HPP
#define ENTERPRISE_SCRIPT_SERVICE_TIMER_HPP

#include <functional>
#include <chrono>
#include <cstdint>
#include <string>

using cpu_time_scale = std::uint64_t;

struct timer {

  std::uint64_t cpu_time_scale_;
  std::function<void(const std::string, const std::int64_t)> writer;

  timer(std::function<void(const std::string, const std::int64_t)> writer);

  struct scope {
    std::string name_;
    std::uint64_t cpu_time_scale_, base_;
    std::function<void(const std::string, const std::int64_t)> writer_;

    scope(const std::string name, const timer &t);
    scope(scope &&rhs) = default;
    scope(const scope &) = delete;
    scope operator=(const scope &) = delete;
    ~scope();
  };

  scope measure(const std::string name) const;
};

#endif

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
script_core-0.3.0 ext/enterprise_script_service/timer.hpp
script_core-0.2.7 ext/enterprise_script_service/timer.hpp
script_core-0.2.6 ext/enterprise_script_service/timer.hpp
script_core-0.2.5 ext/enterprise_script_service/timer.hpp
script_core-0.2.4 ext/enterprise_script_service/timer.hpp
script_core-0.2.3 ext/enterprise_script_service/timer.hpp
script_core-0.2.2 ext/enterprise_script_service/timer.hpp
script_core-0.2.1 ext/enterprise_script_service/timer.hpp
script_core-0.2.0 ext/enterprise_script_service/timer.hpp
script_core-0.1.1 ext/enterprise_script_service/timer.hpp
script_core-0.1.0 ext/enterprise_script_service/timer.hpp
script_core-0.0.6 ext/enterprise_script_service/timer.hpp
script_core-0.0.5 ext/enterprise_script_service/timer.hpp
script_core-0.0.4 ext/enterprise_script_service/timer.hpp
script_core-0.0.3 ext/enterprise_script_service/timer.hpp
script_core-0.0.2 ext/enterprise_script_service/timer.hpp
script_core-0.0.1 ext/enterprise_script_service/timer.hpp