Skip to content

Commit ac4aac7

Browse files
committed
Added get_start_time()
1 parent d0e3032 commit ac4aac7

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

org.lflang/src/lib/Python/pythontarget.c

+9
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,14 @@ static PyObject* py_get_elapsed_physical_time(PyObject *self, PyObject *args) {
218218
return PyLong_FromLong(get_elapsed_physical_time());
219219
}
220220

221+
/**
222+
* Return the start time in nanoseconds.
223+
*/
224+
instant_t get_start_time();
225+
static PyObject* py_get_start_time(PyObject *self, PyObject *args) {
226+
return PyLong_FromLong(get_start_time());
227+
}
228+
221229
/**
222230
* Prototype for the main function.
223231
*/
@@ -720,6 +728,7 @@ static PyMethodDef GEN_NAME(MODULE_NAME,_methods)[] = {
720728
{"get_logical_time", py_get_logical_time, METH_NOARGS, NULL},
721729
{"get_physical_time", py_get_physical_time, METH_NOARGS, NULL},
722730
{"get_elapsed_physical_time", py_get_elapsed_physical_time, METH_NOARGS, NULL},
731+
{"get_start_time", py_get_start_time, METH_NOARGS, NULL},
723732
{"request_stop", py_request_stop, METH_NOARGS, NULL},
724733
{NULL, NULL, 0, NULL}
725734
};

org.lflang/src/lib/Python/pythontarget.h

+5
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,11 @@ static PyObject* py_get_physical_time(PyObject *self, PyObject *args);
247247
instant_t get_elapsed_physical_time();
248248
static PyObject* py_get_elapsed_physical_time(PyObject *self, PyObject *args);
249249

250+
/**
251+
* Return the start time in nanoseconds.
252+
*/
253+
static PyObject* py_get_start_time(PyObject *self, PyObject *args);
254+
250255
/**
251256
* Stop execution at the conclusion of the current logical time.
252257
*/

0 commit comments

Comments
 (0)