Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
305b81db
Commit
305b81db
authored
Sep 09, 2009
by
Martin Sustrik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
higher precision time measurement in python perf tests
parent
4d07d7ca
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
9 deletions
+10
-9
local_thr.py
perf/python/local_thr.py
+4
-4
remote_lat.py
perf/python/remote_lat.py
+6
-5
No files found.
perf/python/local_thr.py
View file @
305b81db
...
...
@@ -18,7 +18,7 @@
#
import
sys
from
datetime
import
date
time
import
time
import
libpyzmq
def
main
():
...
...
@@ -41,15 +41,15 @@ def main ():
msg
=
s
.
recv
()
assert
len
(
msg
)
==
message_size
start
=
datetime
.
now
()
start
=
time
.
clock
()
for
i
in
range
(
1
,
message_count
):
msg
=
s
.
recv
()
assert
len
(
msg
)
==
message_size
end
=
datetime
.
now
()
end
=
time
.
clock
()
elapsed
=
(
end
-
start
)
.
seconds
*
1000000
+
(
end
-
start
)
.
microseconds
elapsed
=
(
end
-
start
)
*
1000000
if
elapsed
==
0
:
elapsed
=
1
throughput
=
(
1000000.0
*
float
(
message_count
))
/
float
(
elapsed
)
...
...
perf/python/remote_lat.py
View file @
305b81db
...
...
@@ -18,7 +18,7 @@
#
import
sys
from
datetime
import
date
time
import
time
import
libpyzmq
def
main
():
...
...
@@ -40,16 +40,17 @@ def main ():
msg
=
''
.
join
([
' '
for
n
in
range
(
0
,
message_size
)])
start
=
datetime
.
now
()
start
=
time
.
clock
()
for
i
in
range
(
0
,
roundtrip_count
):
s
.
send
(
msg
)
msg
=
s
.
recv
()
assert
len
(
msg
)
==
message_size
end
=
datetime
.
now
()
delta
=
(
end
-
start
)
.
microseconds
+
1000000
*
(
end
-
start
)
.
seconds
latency
=
float
(
delta
)
/
roundtrip_count
/
2
end
=
time
.
clock
()
elapsed
=
(
end
-
start
)
*
1000000
latency
=
elapsed
/
roundtrip_count
/
2
print
"message size:
%.0
f [B]"
%
(
message_size
,
)
print
"roundtrip count:
%.0
f"
%
(
roundtrip_count
,
)
...
...
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