Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions planes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@
TIMER_FUNC = None

if platform.system().lower() == "windows":

TIMER_FUNC = time.clock
try:
TIMER_FUNC = time.clock
except AttributeError: #Post python 3.3
TIMER_FUNC = time.perf_counter

else:
TIMER_FUNC = time.time
Expand Down Expand Up @@ -907,13 +909,13 @@ def render(self, force = False):
If force is True, blit to Pygame display regardless.
"""

starttime = time.clock()
starttime = TIMER_FUNC()

self.display.blit(self.image, (0, 0))

rendered_something = Plane.render(self, self.display, self.rect)

STATS.log_render_time(time.clock() - starttime)
STATS.log_render_time(TIMER_FUNC() - starttime)

if rendered_something or force or self.dragged_plane is not None:

Expand Down