Staging
v0.5.1
v0.5.1
Revision 3c2b6f54005fe45225f417bb95e469953311c0a6 authored by Jeremy Hylton on 18 December 2001, 00:06:03 UTC, committed by Jeremy Hylton on 18 December 2001, 00:06:03 UTC
Add is_constant_false(), rev 1.41. Fixed print handling, rev. 1.41. Handle private names, 1.42. Make sure JUMP_ABS and POP_BLOCK blocks are contiguous, rev. 1.44. Make sure class object has no co_varnames, rev. 1.45. Fix typo in visitDict(), rev. 1.46. Generate correct code for continue in try/except, rev. 1.47.
1 parent 317acd0
timingmodule.c
/*
* Author: George V. Neville-Neil
*/
#include "Python.h"
/* Our stuff... */
#include "timing.h"
static PyObject *
start_timing(PyObject *self, PyObject *args)
{
if (!PyArg_Parse(args, ""))
return NULL;
Py_INCREF(Py_None);
BEGINTIMING;
return Py_None;
}
static PyObject *
finish_timing(PyObject *self, PyObject *args)
{
if (!PyArg_Parse(args, ""))
return NULL;
ENDTIMING
Py_INCREF(Py_None);
return Py_None;
}
static PyObject *
seconds(PyObject *self, PyObject *args)
{
if (!PyArg_Parse(args, ""))
return NULL;
return PyInt_FromLong(TIMINGS);
}
static PyObject *
milli(PyObject *self, PyObject *args)
{
if (!PyArg_Parse(args, ""))
return NULL;
return PyInt_FromLong(TIMINGMS);
}
static PyObject *
micro(PyObject *self, PyObject *args)
{
if (!PyArg_Parse(args, ""))
return NULL;
return PyInt_FromLong(TIMINGUS);
}
static PyMethodDef timing_methods[] = {
{"start", start_timing},
{"finish", finish_timing},
{"seconds", seconds},
{"milli", milli},
{"micro", micro},
{NULL, NULL}
};
DL_EXPORT(void) inittiming(void)
{
(void)Py_InitModule("timing", timing_methods);
}
Computing file changes ...