Browse Source

std::chrono support in stormpy

refactoring
Sebastian Junges 7 years ago
parent
commit
4ef4844c30
  1. 2
      src/mod_utility.cpp
  2. 8
      src/utility/chrono.cpp
  3. 5
      src/utility/chrono.h

2
src/mod_utility.cpp

@ -2,6 +2,7 @@
#include "utility/shortestPaths.h"
#include "utility/smtsolver.h"
#include "utility/chrono.h"
PYBIND11_MODULE(utility, m) {
@ -9,4 +10,5 @@ PYBIND11_MODULE(utility, m) {
define_ksp(m);
define_smt(m);
define_chrono(m);
}

8
src/utility/chrono.cpp

@ -0,0 +1,8 @@
#include "chrono.h"
#include "src/helpers.h"
void define_chrono(py::module& m) {
py::class_<std::chrono::milliseconds>(m, "milliseconds")
.def("count", &std::chrono::milliseconds::count)
.def("__str__", [](std::chrono::milliseconds const& t) { std::stringstream strstr; strstr << t.count(); return strstr.str(); });
}

5
src/utility/chrono.h

@ -0,0 +1,5 @@
#pragma once
#include "src/common.h"
void define_chrono(py::module& m);
Loading…
Cancel
Save