Code Search for Developers
 
 
  

Timing.py from The Nebula Device at Krugle


Show Timing.py syntax highlighted

#
#   Get time in platform-dependent way
#

import os
from sys import platform, exit, stderr

if platform == 'mac':
  import MacOS
  def time():
    return MacOS.GetTicks() / 60.0
  timekind = "real"
elif hasattr(os, 'times'):
  def time():
    t = os.times()
    return t[0] + t[1]
  timekind = "cpu"
else:
  stderr.write(
    "Don't know how to get time on platform %s\n" % repr(platform))
  exit(1)





See more files for this project here

The Nebula Device

Realtime 3D game/visualization engine, written in C++, scriptable through Tcl/Tk, Python and Lua. Supports D3D and OpenGL for rendering, runs under Linux and Windows.

Project homepage: http://sourceforge.net/projects/nebuladevice
Programming language(s): C,C++,Python
License: other

  Actions.py
  DFA.py
  Errors.py
  Lexicons.py
  Machines.py
  README
  Regexps.py
  Scanners.py
  TODO
  Timing.py
  Traditional.py
  Transitions.py
  __init__.py
  test_tm.py