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
126c8b4a
Kaydet (Commit)
126c8b4a
authored
Ock 15, 2011
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Avoid ResourceWarnings in ccbench
üst
6a002c02
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
12 deletions
+13
-12
ccbench.py
Tools/ccbench/ccbench.py
+13
-12
No files found.
Tools/ccbench/ccbench.py
Dosyayı görüntüle @
126c8b4a
...
...
@@ -276,19 +276,19 @@ def _recv(sock, n):
return
sock
.
recv
(
n
)
.
decode
(
'ascii'
)
def
latency_client
(
addr
,
nb_pings
,
interval
):
sock
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_DGRAM
)
_time
=
time
.
time
_sleep
=
time
.
sleep
def
_ping
():
_sendto
(
sock
,
"
%
r
\n
"
%
_time
(),
addr
)
# The first ping signals the parent process that we are ready.
_ping
()
# We give the parent a bit of time to notice.
_sleep
(
1.0
)
for
i
in
range
(
nb_pings
):
_sleep
(
interval
)
with
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_DGRAM
)
as
sock
:
_time
=
time
.
time
_sleep
=
time
.
sleep
def
_ping
():
_sendto
(
sock
,
"
%
r
\n
"
%
_time
(),
addr
)
# The first ping signals the parent process that we are ready.
_ping
()
_sendto
(
sock
,
LAT_END
+
"
\n
"
,
addr
)
# We give the parent a bit of time to notice.
_sleep
(
1.0
)
for
i
in
range
(
nb_pings
):
_sleep
(
interval
)
_ping
()
_sendto
(
sock
,
LAT_END
+
"
\n
"
,
addr
)
def
run_latency_client
(
**
kwargs
):
cmd_line
=
[
sys
.
executable
,
'-E'
,
os
.
path
.
abspath
(
__file__
)]
...
...
@@ -363,6 +363,7 @@ def run_latency_test(func, args, nthreads):
for
t
in
threads
:
t
.
join
()
process
.
wait
()
sock
.
close
()
for
recv_time
,
chunk
in
chunks
:
# NOTE: it is assumed that a line sent by a client wasn't received
...
...
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