make stat dir
This commit is contained in:
parent
7685c5a08b
commit
e486f0ea70
|
@ -1,6 +1,7 @@
|
|||
import cProfile
|
||||
from time import strftime
|
||||
from os.path import join
|
||||
from os import mkdir
|
||||
from os.path import join, exists
|
||||
|
||||
from GameChild import GameChild
|
||||
|
||||
|
@ -17,6 +18,9 @@ class Profile(cProfile.Profile, GameChild):
|
|||
|
||||
def end(self):
|
||||
if self.requested():
|
||||
root = "stat/"
|
||||
if not exists(root):
|
||||
mkdir(root)
|
||||
self.disable()
|
||||
self.create_stats()
|
||||
self.dump_stats(join("stat/", strftime("%Y%m%d-%H%M_%S.stat")))
|
||||
self.dump_stats(join(root, strftime("%Y%m%d-%H%M_%S.stat")))
|
||||
|
|
Loading…
Reference in New Issue