I see there's at least two common ways to get the current mission time, Missiontime and timestamp(). However, they don't produce the same values or even almost the same; the longer the mission runs, the more the values they return diverge from each other. Initially timestamp() returns a very slightly bigger value, but Missiontime overtakes it in less than a second and then consistently stays higher afterwards. However, I don't know which one of them returns the correct value.
So... what's going on? Is this a bug? Or am I missing something? Should one of them not be used for getting the current time? Both seem to be used for that purpose in many places.
Here's a simple test case. Just run the game and check the output from fs2_open.log:
Index: freespace.cpp
===================================================================
--- freespace.cpp (revision 8006)
+++ freespace.cpp (working copy)
@@ -4420,6 +4420,8 @@
game_simulation_frame();
+
+ mprintf(("Difference between Missiontime and timestamp(): %f seconds\n", f2fl(Missiontime) - (float)timestamp()/1000.0f));
// if not actually in a game play state, then return. This condition could only be true in
// a multiplayer game.