[Patch #1068277] Clarify that os.path.exists() can return False depending on permissi...
[pytest.git] / Modules / timingmodule.c
blob56e057a656a3aa2796a1ae03b72f733910b1aa11
1 /*
2 * Author: George V. Neville-Neil
3 */
5 #include "Python.h"
7 /* Our stuff... */
8 #include "timing.h"
10 static PyObject *
11 start_timing(PyObject *self)
13 Py_INCREF(Py_None);
14 BEGINTIMING;
15 return Py_None;
18 static PyObject *
19 finish_timing(PyObject *self)
21 ENDTIMING
22 Py_INCREF(Py_None);
23 return Py_None;
26 static PyObject *
27 seconds(PyObject *self)
29 return PyInt_FromLong(TIMINGS);
32 static PyObject *
33 milli(PyObject *self)
35 return PyInt_FromLong(TIMINGMS);
38 static PyObject *
39 micro(PyObject *self)
41 return PyInt_FromLong(TIMINGUS);
45 static PyMethodDef timing_methods[] = {
46 {"start", (PyCFunction)start_timing, METH_NOARGS},
47 {"finish", (PyCFunction)finish_timing, METH_NOARGS},
48 {"seconds", (PyCFunction)seconds, METH_NOARGS},
49 {"milli", (PyCFunction)milli, METH_NOARGS},
50 {"micro", (PyCFunction)micro, METH_NOARGS},
51 {NULL, NULL}
55 PyMODINIT_FUNC inittiming(void)
57 (void)Py_InitModule("timing", timing_methods);