Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions swig/modelname.template.i
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ using namespace amici;
// store the time a module was imported
%{
#include <chrono>
static std::chrono::time_point<std::chrono::system_clock> _module_import_time;
static std::chrono::time_point<std::chrono::system_clock> _module_import_time = std::chrono::system_clock::now();

static double _get_import_time() {
auto epoch = _module_import_time.time_since_epoch();
Expand All @@ -68,7 +68,9 @@ static double _get_import_time() {
static double _get_import_time();

%init %{
_module_import_time = std::chrono::system_clock::now();
// NOTE: from SWIG 4.4.0 onwards, %init code is executed every time the
// module is executed - not only on first import
// This code ends up in `SWIG_mod_exec`.
%}


Expand Down
Loading