Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import requests
- from datetime import datetime
- sent = datetime.now().microsecond
- r = requests.post("http://localhost:3000/data", data={'avg_temp': 22, 'time': sent})
- if r.status_code == 200:
- received = datetime.now().microsecond
- print("Delay is", (received - sent)/1000, "milliseconds")
- print(r.status_code, r.reason)
- r.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement