diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2023-11-09 08:08:38 -0500 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2023-11-09 08:08:38 -0500 |
commit | 3dc947a7575bd23703644996d8e853e5e618b2e3 (patch) | |
tree | c91ff763003cb1b83f76c31b0948ff8699280f57 /alee-standalone.cpp | |
parent | b33c0c564c51252ff241a2143e467dadfb8d8994 (diff) |
fix execute; disable verify(); bench w/ standalone
Diffstat (limited to 'alee-standalone.cpp')
-rw-r--r-- | alee-standalone.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/alee-standalone.cpp b/alee-standalone.cpp index 5681dbf..0285701 100644 --- a/alee-standalone.cpp +++ b/alee-standalone.cpp @@ -20,6 +20,7 @@ #include "splitmemdict.hpp" #include <charconv> +#include <chrono> #include <fstream> #include <iostream> #include <vector> @@ -83,6 +84,8 @@ static void load(State& state) void user_sys(State& state) { + static bool start = false; + static decltype(std::chrono::high_resolution_clock::now()) last; char buf[32] = {0}; switch (state.pop()) { @@ -103,6 +106,20 @@ void user_sys(State& state) case 4: // load load(state); break; + case 5: // time + if (!start) { + start = true; + last = std::chrono::high_resolution_clock::now(); + } else { + start = false; + auto diff = std::chrono::duration_cast<std::chrono::microseconds>( + std::chrono::high_resolution_clock::now() - last); + state.push((Cell)diff.count()); + } + break; + case 6: // double-add + { auto sum = state.popd() + state.popd(); state.pushd(sum); } + break; default: break; } |