##// END OF EJS Templates
statprof: fix save and load...
Boris Feld -
r38293:99188a7c default
parent child Browse files
Show More
@@ -350,7 +350,7 b' def stop():'
350
350
351 def save_data(path):
351 def save_data(path):
352 with open(path, 'w+') as file:
352 with open(path, 'w+') as file:
353 file.write(str(state.accumulated_time) + '\n')
353 file.write("%f %f\n" % state.accumulated_time)
354 for sample in state.samples:
354 for sample in state.samples:
355 time = str(sample.time)
355 time = str(sample.time)
356 stack = sample.stack
356 stack = sample.stack
@@ -361,7 +361,7 b' def save_data(path):'
361 def load_data(path):
361 def load_data(path):
362 lines = open(path, 'r').read().splitlines()
362 lines = open(path, 'r').read().splitlines()
363
363
364 state.accumulated_time = float(lines[0])
364 state.accumulated_time = [float(value) for value in lines[0].split()]
365 state.samples = []
365 state.samples = []
366 for line in lines[1:]:
366 for line in lines[1:]:
367 parts = line.split('\0')
367 parts = line.split('\0')
General Comments 0
You need to be logged in to leave comments. Login now