From bf01cea0626d666b588c32497332d3916cd9a435 Mon Sep 17 00:00:00 2001 From: Unbit Date: Sat, 12 Apr 2014 18:34:57 +0200 Subject: [PATCH] added micros() api function --- plugins/python/uwsgi_pymodule.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/python/uwsgi_pymodule.c b/plugins/python/uwsgi_pymodule.c index 7d68fc1e..08e69678 100644 --- a/plugins/python/uwsgi_pymodule.c +++ b/plugins/python/uwsgi_pymodule.c @@ -23,6 +23,9 @@ static PyObject *py_uwsgi_add_var(PyObject * self, PyObject * args) { return Py_True; } +static PyObject *py_uwsgi_micros(PyObject * self, PyObject * args) { + return PyLong_FromUnsignedLongLong(uwsgi_micros()); +} static PyObject *py_uwsgi_signal_wait(PyObject * self, PyObject * args) { @@ -2439,6 +2442,8 @@ static PyMethodDef uwsgi_advanced_methods[] = { {"add_var", py_uwsgi_add_var, METH_VARARGS, ""}, + {"micros", py_uwsgi_micros, METH_VARARGS, ""}, + {NULL, NULL}, };