Skip to content
Snippets Groups Projects
Commit bcfb79fb authored by Benjamin Cumming's avatar Benjamin Cumming
Browse files

add timing to the ball_and_3stick validation test

parent a772ff2e
No related branches found
No related tags found
No related merge requests found
...@@ -89,7 +89,7 @@ for nseg in [5, 11, 51, 101] : ...@@ -89,7 +89,7 @@ for nseg in [5, 11, 51, 101] :
# record spikes # record spikes
# this is a bit verbose, no? # this is a bit verbose, no?
spike_counter_soma = h.APCount(soma(0.5)) 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 = h.APCount(dend[0](1))
spike_counter_dend.thresh = -20 spike_counter_dend.thresh = -20
spike_counter_clamp = h.APCount(dend[1](1.0)) spike_counter_clamp = h.APCount(dend[1](1.0))
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include <iomanip> #include <iomanip>
#include <chrono>
#include <cmath> #include <cmath>
...@@ -14,6 +15,22 @@ ...@@ -14,6 +15,22 @@
namespace testing{ 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 [[gnu::unused]] static
void write_vis_file(const std::string& fname, std::vector<std::vector<double>> values) void write_vis_file(const std::string& fname, std::vector<std::vector<double>> values)
{ {
......
...@@ -240,6 +240,7 @@ TEST(ball_and_3stick, neuron_baseline) ...@@ -240,6 +240,7 @@ TEST(ball_and_3stick, neuron_baseline)
}; };
std::vector<result> results; std::vector<result> results;
auto start = testing::tic();
for(auto run_index=0u; run_index<cell_data.size(); ++run_index) { for(auto run_index=0u; run_index<cell_data.size(); ++run_index) {
auto& run = cell_data[run_index]; auto& run = cell_data[run_index];
int num_compartments = run["nseg"]; int num_compartments = run["nseg"];
...@@ -274,6 +275,8 @@ TEST(ball_and_3stick, neuron_baseline) ...@@ -274,6 +275,8 @@ TEST(ball_and_3stick, neuron_baseline)
results.push_back( {num_compartments, dt, v, measurements} ); results.push_back( {num_compartments, dt, v, measurements} );
} }
auto time_taken = testing::toc(start);
std::cout << "took " << time_taken << " seconds\n";
// print results // print results
auto colors = {memory::util::kWhite, memory::util::kGreen, memory::util::kYellow}; auto colors = {memory::util::kWhite, memory::util::kGreen, memory::util::kYellow};
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment