Skip to content

Instantly share code, notes, and snippets.

@NickCody
Created April 28, 2019 22:05
Show Gist options
  • Save NickCody/9e676e3ae7bf9db32ef7ef3462d48f86 to your computer and use it in GitHub Desktop.
Save NickCody/9e676e3ae7bf9db32ef7ef3462d48f86 to your computer and use it in GitHub Desktop.
lps.py
#!/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
@NickCody
Copy link
Author

NickCody commented Apr 28, 2019

lps.py

A little program that will count lines per second from stdin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment