@@ -145,44 +145,6 @@ perf_counter(_Py_clock_info_t *info)
145145 return _PyFloat_FromPyTime (t );
146146}
147147
148- #if (defined(MS_WINDOWS ) || defined(HAVE_CLOCK )) && !defined(__VXWORKS__ )
149- #define PYCLOCK
150- static PyObject *
151- pyclock (_Py_clock_info_t * info )
152- {
153- if (PyErr_WarnEx (PyExc_DeprecationWarning ,
154- "time.clock has been deprecated in Python 3.3 and will "
155- "be removed from Python 3.8: "
156- "use time.perf_counter or time.process_time "
157- "instead" , 1 ) < 0 ) {
158- return NULL ;
159- }
160-
161- #ifdef MS_WINDOWS
162- return perf_counter (info );
163- #else
164- _PyTime_t t ;
165- if (_PyTime_GetClockWithInfo (& t , info ) < 0 ) {
166- return NULL ;
167- }
168- return _PyFloat_FromPyTime (t );
169- #endif
170- }
171-
172- static PyObject *
173- time_clock (PyObject * self , PyObject * unused )
174- {
175- return pyclock (NULL );
176- }
177-
178- PyDoc_STRVAR (clock_doc ,
179- "clock() -> floating point number\n\
180- \n\
181- Return the CPU time or real time since the start of the process or since\n\
182- the first call to clock(). This has as much precision as the system\n\
183- records." );
184- #endif
185-
186148#ifdef HAVE_CLOCK_GETTIME
187149static PyObject *
188150time_clock_gettime (PyObject * self , PyObject * args )
@@ -1477,15 +1439,6 @@ time_get_clock_info(PyObject *self, PyObject *args)
14771439 return NULL ;
14781440 }
14791441 }
1480- #ifdef PYCLOCK
1481- else if (strcmp (name , "clock ") == 0 ) {
1482- obj = pyclock (& info );
1483- if (obj == NULL) {
1484- return NULL ;
1485- }
1486- Py_DECREF (obj );
1487- }
1488- #endif
14891442 else if (strcmp (name , "monotonic" ) == 0 ) {
14901443 if (_PyTime_GetMonotonicClockWithInfo (& t , & info ) < 0 ) {
14911444 return NULL ;
@@ -1700,9 +1653,6 @@ init_timezone(PyObject *m)
17001653static PyMethodDef time_methods [] = {
17011654 {"time" , time_time , METH_NOARGS , time_doc },
17021655 {"time_ns" , time_time_ns , METH_NOARGS , time_ns_doc },
1703- #ifdef PYCLOCK
1704- {"clock" , time_clock , METH_NOARGS , clock_doc },
1705- #endif
17061656#ifdef HAVE_CLOCK_GETTIME
17071657 {"clock_gettime" , time_clock_gettime , METH_VARARGS , clock_gettime_doc },
17081658 {"clock_gettime_ns" ,time_clock_gettime_ns , METH_VARARGS , clock_gettime_ns_doc },
0 commit comments