Staging
v0.5.1
https://github.com/python/cpython
Revision 0cc3ea620c4b13d7f0a23062e4108fc05d870a8e authored by Martin v. Löwis on 02 March 2008, 17:47:51 UTC, committed by Martin v. Löwis on 02 March 2008, 17:47:51 UTC
problems:
52448, 52468, 52472, 52475, 52646, 52797, 52802, 52863, 52999, 53001,
53101, 53371, 53373, 53383, 53384, 53736, 53812, 53921, 55578, 55580,
55581, 55772, 55775, 56557, 57093, 57094, 58630, 60114
1 parent 0e42f0e
Raw File
Tip revision: 0cc3ea620c4b13d7f0a23062e4108fc05d870a8e authored by Martin v. Löwis on 02 March 2008, 17:47:51 UTC
Revert the following revisions, as they don't fix security
Tip revision: 0cc3ea6
timingmodule.c
/*
 * Author: George V. Neville-Neil
 */

#include "Python.h"

/* Our stuff... */
#include "timing.h"

static PyObject *
start_timing(PyObject *self)
{
	Py_INCREF(Py_None);
	BEGINTIMING;
	return Py_None;
}

static PyObject *
finish_timing(PyObject *self)
{
	ENDTIMING    
	Py_INCREF(Py_None);
	return Py_None;
}

static PyObject *
seconds(PyObject *self)
{
	return PyInt_FromLong(TIMINGS);
}

static PyObject *
milli(PyObject *self)
{
	return PyInt_FromLong(TIMINGMS);
}

static PyObject *
micro(PyObject *self)
{
	return PyInt_FromLong(TIMINGUS);
}


static PyMethodDef timing_methods[] = {
	{"start",   (PyCFunction)start_timing, METH_NOARGS},
	{"finish",  (PyCFunction)finish_timing, METH_NOARGS},
	{"seconds", (PyCFunction)seconds, METH_NOARGS},
	{"milli",   (PyCFunction)milli, METH_NOARGS},
	{"micro",   (PyCFunction)micro, METH_NOARGS},
	{NULL,      NULL}
};


PyMODINIT_FUNC inittiming(void)
{
	(void)Py_InitModule("timing", timing_methods);
}
back to top