Created
July 27, 2015 16:02
-
-
Save yamionp/0d02caa0f9179d749430 to your computer and use it in GitHub Desktop.
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
import time | |
import os | |
DATA = 'aaaaaaaaaabbbbbbbbbbccccccccccdddddddddd'*100000 | |
def main(): | |
with open('/tmp/test.log', 'w') as f: | |
for i in xrange(1000): | |
start_at = time.time() | |
f.write(DATA) | |
f.flush() | |
os.fsync(f.fileno()) | |
print '{0:>10}\t{1:d}'.format(i, int((time.time() - start_at)*1000)) | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment