Skip to content

Instantly share code, notes, and snippets.

@aorjoa
Created May 17, 2015 02:15
Show Gist options
  • Save aorjoa/001b66910cd646d6c691 to your computer and use it in GitHub Desktop.
Save aorjoa/001b66910cd646d6c691 to your computer and use it in GitHub Desktop.
def main():
x = 1
y = ""
time = 0
loop = 0
f = open('prepare_data.txt','r')
for line in f:
if line.startswith('real'):
time+=(float(".".join(line.split("\t")[1].split('m')[1][:-2].split('.'))))
if x%10 == 0 :
print str(x)+","+str(y)+","+str(time/float(10))
time=0
x = x+1
if line.startswith('Container'):
pass
if line.startswith('********************** '):
y=line.split(" ")[1]
x = 1
if line.startswith('loop'):
x = 1
loop = int(line.split(' ')[2])
print "\n"+line
f.close()
#print loop
if __name__ == "__main__":
main()
# def main():
# x = 1
# y = ""
# time = ""
# loop = 0
# f = open('prepare_data.txt','r')
# for line in f:
# if line.startswith('real'):
# time="".join(line.split("\t")[1].split('m')[1][:-2].split('.'))
# print " \""+str(x)+"\":{\"time(ms)\":\""+time+"\"},"
# x = x+1
# if line.startswith('Container'):
# print " }\n }\n"
# if line.startswith('********************** '):
# y=line.split(" ")[1]
# print "{\""+y+"\":{"
# x = 1
# if line.startswith('loop'):
# x = 1
# loop = int(line.split(' ')[2])
# print "\n}\n"+line
# f.close()
# #print loop
# if __name__ == "__main__":
# main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment