diff --git a/nrn/ball_and_3stick.py b/nrn/ball_and_3stick.py index 3e777261f88fde9c53407d10fe0a6fe74cec4c5e..15ece3d3da151daf7bdb90f1af1d6cd368352489 100644 --- a/nrn/ball_and_3stick.py +++ b/nrn/ball_and_3stick.py @@ -89,7 +89,7 @@ for nseg in [5, 11, 51, 101] : # record spikes # this is a bit verbose, no? spike_counter_soma = h.APCount(soma(0.5)) - spike_counter_soma.thresh = -0 + spike_counter_soma.thresh = 0 spike_counter_dend = h.APCount(dend[0](1)) spike_counter_dend.thresh = -20 spike_counter_clamp = h.APCount(dend[1](1.0)) diff --git a/tests/util.hpp b/tests/util.hpp index b5e25d72d0ab5d141f581d183771f249e48f438b..aeb2f8d3e585a1603de6c7745b566a8b11aee12c 100644 --- a/tests/util.hpp +++ b/tests/util.hpp @@ -3,6 +3,7 @@ #include <string> #include <vector> #include <iomanip> +#include <chrono> #include <cmath> @@ -14,6 +15,22 @@ namespace testing{ +using time_point = std::chrono::time_point<std::chrono::system_clock>; +using duration_type = std::chrono::duration<double>; + +static inline +time_point tic() +{ + return std::chrono::system_clock::now(); +} + +static inline +double toc(time_point start) +{ + return duration_type(tic() - start).count(); +} + + [[gnu::unused]] static void write_vis_file(const std::string& fname, std::vector<std::vector<double>> values) { diff --git a/tests/validate_ball_and_stick.cpp b/tests/validate_ball_and_stick.cpp index 024c7fdbde036cadf169744a1cc95269bc2778d4..a2aef0ada111aa7ecb8d150034a437016e987ce1 100644 --- a/tests/validate_ball_and_stick.cpp +++ b/tests/validate_ball_and_stick.cpp @@ -240,6 +240,7 @@ TEST(ball_and_3stick, neuron_baseline) }; std::vector<result> results; + auto start = testing::tic(); for(auto run_index=0u; run_index<cell_data.size(); ++run_index) { auto& run = cell_data[run_index]; int num_compartments = run["nseg"]; @@ -274,6 +275,8 @@ TEST(ball_and_3stick, neuron_baseline) results.push_back( {num_compartments, dt, v, measurements} ); } + auto time_taken = testing::toc(start); + std::cout << "took " << time_taken << " seconds\n"; // print results auto colors = {memory::util::kWhite, memory::util::kGreen, memory::util::kYellow};