# File: statcache-example-1.py import statcache import os, stat, time now = time.time() for i in range(1000): st = os.stat("samples/sample.txt") print "os.stat", "=>", time.time() - now now = time.time() for i in range(1000): st = statcache.stat("samples/sample.txt") print "statcache.stat", "=>", time.time() - now print "mode", "=>", oct(stat.S_IMODE(st[stat.ST_MODE])) print "size", "=>", st[stat.ST_SIZE] print "last modified", "=>", time.ctime(st[stat.ST_MTIME])