Commit 5b22a572 authored by Barry Warsaw's avatar Barry Warsaw

Renamed.

parent 48ebbb84
......@@ -2,77 +2,74 @@
* Author: George V. Neville-Neil
*/
#include "allobjects.h"
#include "import.h"
#include "modsupport.h"
#include "ceval.h"
#include "Python.h"
/* Our stuff... */
#include "timing.h"
static object *
static PyObject *
start_timing(self, args)
object *self;
object *args;
PyObject *self;
PyObject *args;
{
if (!getargs(args, ""))
if (!PyArg_Parse(args, ""))
return NULL;
INCREF(None);
Py_INCREF(Py_None);
BEGINTIMING;
return None;
return Py_None;
}
static object *
static PyObject *
finish_timing(self, args)
object *self;
object *args;
PyObject *self;
PyObject *args;
{
if (!getargs(args, ""))
if (!PyArg_Parse(args, ""))
return NULL;
ENDTIMING
INCREF(None);
return None;
Py_INCREF(Py_None);
return Py_None;
}
static object *
static PyObject *
seconds(self, args)
object *self;
object *args;
PyObject *self;
PyObject *args;
{
if (!getargs(args, ""))
if (!PyArg_Parse(args, ""))
return NULL;
return newintobject(TIMINGS);
return PyInt_FromLong(TIMINGS);
}
static object *
static PyObject *
milli(self, args)
object *self;
object *args;
PyObject *self;
PyObject *args;
{
if (!getargs(args, ""))
if (!PyArg_Parse(args, ""))
return NULL;
return newintobject(TIMINGMS);
return PyInt_FromLong(TIMINGMS);
}
static object *
static PyObject *
micro(self, args)
object *self;
object *args;
PyObject *self;
PyObject *args;
{
if (!getargs(args, ""))
if (!PyArg_Parse(args, ""))
return NULL;
return newintobject(TIMINGUS);
return PyInt_FromLong(TIMINGUS);
}
static struct methodlist timing_methods[] = {
static PyMethodDef timing_methods[] = {
{"start", start_timing},
{"finish", finish_timing},
{"seconds", seconds},
......@@ -84,8 +81,7 @@ static struct methodlist timing_methods[] = {
void inittiming()
{
object *m;
m = initmodule("timing", timing_methods);
(void)Py_InitModule("timing", timing_methods);
if (PyErr_Occurred())
Py_FatalError("can't initialize module timing");
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment