mirror of https://github.com/kivy/kivy.git
19 lines
518 B
Python
19 lines
518 B
Python
|
from kivy.core.window import Window
|
||
|
from kivy.graphics.svg import Svg
|
||
|
from time import time
|
||
|
import sys
|
||
|
import os
|
||
|
|
||
|
filename = sys.argv[1]
|
||
|
if "PROFILE" in os.environ:
|
||
|
import pstats, cProfile
|
||
|
cProfile.runctx("Svg(filename)", globals(), locals(), "Profile.prof")
|
||
|
s = pstats.Stats("Profile.prof")
|
||
|
s.strip_dirs().sort_stats("time").print_callers()
|
||
|
else:
|
||
|
print("Loading {}".format(filename))
|
||
|
start = time()
|
||
|
svg = Svg(filename)
|
||
|
end = time()
|
||
|
print("Loaded in {:.2f}s".format((end - start)))
|