aboutsummaryrefslogtreecommitdiff
path: root/src/physics.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/physics.c')
-rw-r--r--src/physics.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/physics.c b/src/physics.c
index 91505b9..7b6b2b7 100644
--- a/src/physics.c
+++ b/src/physics.c
@@ -407,11 +407,13 @@ void physics_step(Game *game, Uint32 t) {
Uint32 dt;
struct timeval tv;
suseconds_t us;
+ time_t sec;
dt = t - game->tlast;
gettimeofday(&tv, NULL);
us = tv.tv_usec;
+ sec = tv.tv_sec;
/* Handle things specific to the lander craft */
if ( game->thrusting ) {
@@ -464,8 +466,9 @@ void physics_step(Game *game, Uint32 t) {
gettimeofday(&tv, NULL);
us = tv.tv_usec - us;
+ sec = tv.tv_sec - sec;
- game->time_physics = us;
+ game->time_physics = us + sec*1e6;
}