Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

get_time.cc

Go to the documentation of this file.
00001 #include "get_time.h"
00002 
00003 #ifdef PLATFORM_APERIOS
00004 
00005 #include <MCOOP.h>
00006 unsigned int get_time() {
00007   static struct SystemTime time;
00008   GetSystemTime(&time);
00009   return time.seconds*1000+time.useconds/1000;
00010 }
00011 
00012 #else
00013 
00014 #include "TimeET.h"
00015 namespace project_get_time {
00016   
00017   unsigned int simulation_time=-1U;
00018   
00019   //! provides default implementation of #get_time_callback -- starts a TimeET instance on the first call and then returns its age thereafter
00020   unsigned int default_get_time_callback() {
00021     static TimeET first;
00022     return static_cast<unsigned int>(first.Age().Value()*1000);
00023   }
00024   
00025   unsigned int (*get_time_callback)()=&default_get_time_callback;
00026   
00027   float (*get_timeScale_callback)()=NULL;
00028   
00029 }
00030 
00031 #endif
00032 
00033 /*! @file
00034  * @brief Implementation of get_time(), a simple way to get the current time since boot in milliseconds
00035  * @author ejt (Creator)
00036  *
00037  * $Author: ejt $
00038  * $Name: tekkotsu-4_0 $
00039  * $Revision: 1.7 $
00040  * $State: Exp $
00041  * $Date: 2007/11/09 19:01:14 $
00042  */

Tekkotsu v4.0
Generated Thu Nov 22 00:54:53 2007 by Doxygen 1.5.4