Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
5b22a572
Commit
5b22a572
authored
Jan 13, 1997
by
Barry Warsaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Renamed.
parent
48ebbb84
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
49 deletions
+45
-49
Modules/timingmodule.c
Modules/timingmodule.c
+45
-49
No files found.
Modules/timingmodule.c
View file @
5b22a572
...
...
@@ -2,90 +2,86 @@
* 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
o
bject
*
static
PyO
bject
*
start_timing
(
self
,
args
)
o
bject
*
self
;
o
bject
*
args
;
PyO
bject
*
self
;
PyO
bject
*
args
;
{
if
(
!
getargs
(
args
,
""
))
return
NULL
;
if
(
!
PyArg_Parse
(
args
,
""
))
return
NULL
;
INCREF
(
None
);
BEGINTIMING
;
return
None
;
Py_INCREF
(
Py_
None
);
BEGINTIMING
;
return
Py_
None
;
}
static
o
bject
*
static
PyO
bject
*
finish_timing
(
self
,
args
)
o
bject
*
self
;
o
bject
*
args
;
PyO
bject
*
self
;
PyO
bject
*
args
;
{
if
(
!
getargs
(
args
,
""
))
return
NULL
;
if
(
!
PyArg_Parse
(
args
,
""
))
return
NULL
;
ENDTIMING
INCREF
(
None
);
return
None
;
ENDTIMING
Py_INCREF
(
Py_
None
);
return
Py_
None
;
}
static
o
bject
*
static
PyO
bject
*
seconds
(
self
,
args
)
o
bject
*
self
;
o
bject
*
args
;
PyO
bject
*
self
;
PyO
bject
*
args
;
{
if
(
!
getargs
(
args
,
""
))
return
NULL
;
if
(
!
PyArg_Parse
(
args
,
""
))
return
NULL
;
return
newintobject
(
TIMINGS
);
return
PyInt_FromLong
(
TIMINGS
);
}
static
o
bject
*
static
PyO
bject
*
milli
(
self
,
args
)
o
bject
*
self
;
o
bject
*
args
;
PyO
bject
*
self
;
PyO
bject
*
args
;
{
if
(
!
getargs
(
args
,
""
))
return
NULL
;
if
(
!
PyArg_Parse
(
args
,
""
))
return
NULL
;
return
newintobject
(
TIMINGMS
);
return
PyInt_FromLong
(
TIMINGMS
);
}
static
o
bject
*
static
PyO
bject
*
micro
(
self
,
args
)
o
bject
*
self
;
o
bject
*
args
;
PyO
bject
*
self
;
PyO
bject
*
args
;
{
if
(
!
getargs
(
args
,
""
))
return
NULL
;
if
(
!
PyArg_Parse
(
args
,
""
))
return
NULL
;
return
newintobject
(
TIMINGUS
);
return
PyInt_FromLong
(
TIMINGUS
);
}
static
struct
methodlist
timing_methods
[]
=
{
{
"start"
,
start_timing
},
{
"finish"
,
finish_timing
},
{
"seconds"
,
seconds
},
{
"milli"
,
milli
},
{
"micro"
,
micro
},
{
NULL
,
NULL
}
static
PyMethodDef
timing_methods
[]
=
{
{
"start"
,
start_timing
},
{
"finish"
,
finish_timing
},
{
"seconds"
,
seconds
},
{
"milli"
,
milli
},
{
"micro"
,
micro
},
{
NULL
,
NULL
}
};
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"
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment