Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
D0020E-projekt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Henrik Tjäder
D0020E-projekt
Commits
c5c2689d
Commit
c5c2689d
authored
10 years ago
by
Henrik Tjäder
Browse files
Options
Downloads
Patches
Plain Diff
Proper creation of the max and min delay
parent
f8d063f8
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
UDP-client-server.py
+5
-2
5 additions, 2 deletions
UDP-client-server.py
with
5 additions
and
2 deletions
UDP-client-server.py
+
5
−
2
View file @
c5c2689d
...
@@ -28,8 +28,10 @@ def udp_client_receive(UDP_RECEIVE_IP, UDP_RECEIVE_PORT):
...
@@ -28,8 +28,10 @@ def udp_client_receive(UDP_RECEIVE_IP, UDP_RECEIVE_PORT):
global
packet_count_rcvd
global
packet_count_rcvd
global
cumulative_delay
global
cumulative_delay
global
min_delay
=
100.
global
min_delay
global
max_delay
=
0.
global
max_delay
min_delay
=
100.
max_delay
=
0.
packet_count_rcvd
=
0
packet_count_rcvd
=
0
cumulative_delay
=
0.
cumulative_delay
=
0.
...
@@ -55,6 +57,7 @@ def udp_client_receive(UDP_RECEIVE_IP, UDP_RECEIVE_PORT):
...
@@ -55,6 +57,7 @@ def udp_client_receive(UDP_RECEIVE_IP, UDP_RECEIVE_PORT):
max_delay
=
rt_delay
max_delay
=
rt_delay
if
rt_delay
<
min_delay
:
if
rt_delay
<
min_delay
:
min_delay
=
rt_delay
min_delay
=
rt_delay
print
(
max_delay
,
min_delay
)
packet_count_rcvd
=
packet_count_rcvd
+
1
packet_count_rcvd
=
packet_count_rcvd
+
1
cumulative_delay
=
cumulative_delay
+
rt_delay
cumulative_delay
=
cumulative_delay
+
rt_delay
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment