Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
a8ec5ea9
Kaydet (Commit)
a8ec5ea9
authored
Mar 12, 2012
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #14104: Implement time.monotonic() on Mac OS X,
patch written by Nicholas Riley.
üst
cad1a07b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletion
+20
-1
NEWS
Misc/NEWS
+3
-0
timemodule.c
Modules/timemodule.c
+17
-1
No files found.
Misc/NEWS
Dosyayı görüntüle @
a8ec5ea9
...
@@ -24,6 +24,9 @@ Core and Builtins
...
@@ -24,6 +24,9 @@ Core and Builtins
Library
Library
-------
-------
-
Issue
#
14104
:
Implement
time
.
monotonic
()
on
Mac
OS
X
,
patch
written
by
Nicholas
Riley
.
-
Issue
#
13394
:
the
aifc
module
now
uses
warnings
.
warn
()
to
signal
warnings
.
-
Issue
#
13394
:
the
aifc
module
now
uses
warnings
.
warn
()
to
signal
warnings
.
-
Issue
#
14252
:
Fix
subprocess
.
Popen
.
terminate
()
to
not
raise
an
error
under
-
Issue
#
14252
:
Fix
subprocess
.
Popen
.
terminate
()
to
not
raise
an
error
under
...
...
Modules/timemodule.c
Dosyayı görüntüle @
a8ec5ea9
...
@@ -40,6 +40,10 @@
...
@@ -40,6 +40,10 @@
#include <sys/time.h>
#include <sys/time.h>
#endif
#endif
#if defined(__APPLE__)
#include <mach/mach_time.h>
#endif
/* Forward declarations */
/* Forward declarations */
static
int
floatsleep
(
double
);
static
int
floatsleep
(
double
);
static
double
floattime
(
void
);
static
double
floattime
(
void
);
...
@@ -816,7 +820,8 @@ of the returned value is undefined so only the difference of consecutive\n\
...
@@ -816,7 +820,8 @@ of the returned value is undefined so only the difference of consecutive\n\
calls is valid."
);
calls is valid."
);
#if (defined(MS_WINDOWS) && !defined(__BORLANDC__)) \
#if (defined(MS_WINDOWS) && !defined(__BORLANDC__)) \
|| (defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC))
|| (defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)) \
|| (defined(__APPLE__))
# define HAVE_PYTIME_MONOTONIC
# define HAVE_PYTIME_MONOTONIC
#endif
#endif
...
@@ -826,6 +831,17 @@ time_monotonic(PyObject *self, PyObject *unused)
...
@@ -826,6 +831,17 @@ time_monotonic(PyObject *self, PyObject *unused)
{
{
#if defined(MS_WINDOWS) && !defined(__BORLANDC__)
#if defined(MS_WINDOWS) && !defined(__BORLANDC__)
return
win32_clock
(
0
);
return
win32_clock
(
0
);
#elif defined(__APPLE__)
uint64_t
time
=
mach_absolute_time
();
double
secs
;
static
mach_timebase_info_data_t
timebase
;
if
(
timebase
.
denom
==
0
)
mach_timebase_info
(
&
timebase
);
secs
=
(
double
)
time
*
timebase
.
numer
/
timebase
.
denom
*
1e-9
;
return
PyFloat_FromDouble
(
secs
);
#else
#else
static
int
clk_index
=
0
;
static
int
clk_index
=
0
;
clockid_t
clk_ids
[]
=
{
clockid_t
clk_ids
[]
=
{
...
...
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