Post subject: difference between Lua timing and DeSmuME timing
Stovent
He/Him
Publisher
Joined: 8/23/2016
Posts: 165
Location: France
Hi, I made an lua script that calculate my time, but this time is different compared to the one given by DeSmuME : it give me 18:57.10 when my script says 19:00.4 for 68028 frames. I saw on this page that DeSmuME's framerate is 59.826098288081, so I made this script :
Language: lua

minutes = 0 secondes = 0 centiemes = 0 FPS = 59.826098288081 function RTA() realTime() gui.text(0, -155, "Time : " ..heures.. ":" ..minutes.. ":" ..secondes) end function realTime() VI = emu.framecount() secondes = VI / FPS minutes = math.floor(secondes / FPS) heures = math.floor(VI / FPS^3) secondes = math.floor((secondes % FPS) * 100 + 0.5) / 100 minutes = math.floor((minutes % FPS) * 100 + 0.5) / 100 end
What's wrong in my script ?
[17:37:00]<TheCoreyBurton> It's N64 - it's ALWAYS bad news.
Amaraticando
It/Its
Editor, Player (162)
Joined: 1/10/2012
Posts: 673
Location: Brazil
Even though a second has 59.826098288081 frames, a minute has 60 seconds and an hour has 60 minutes.
Masterjun
He/Him
Site Developer, Expert player (2047)
Joined: 10/12/2010
Posts: 1185
Location: Germany
LOL
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)
Stovent
He/Him
Publisher
Joined: 8/23/2016
Posts: 165
Location: France
Thanks, I forgot this. lol
[17:37:00]<TheCoreyBurton> It's N64 - it's ALWAYS bad news.