Created
April 28, 2019 22:05
-
-
Save NickCody/9e676e3ae7bf9db32ef7ef3462d48f86 to your computer and use it in GitHub Desktop.
lps.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import time | |
import sys | |
def epoch(): | |
return int(time.time()) | |
c = epoch() | |
l = 0 | |
for line in sys.stdin: | |
l=l+1 | |
if (epoch() > c): | |
c=epoch() | |
print str(c) + "," + str(l) | |
sys.stdout.flush() | |
l=0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
lps.py
A little program that will count lines per second from stdin.