tag:blogger.com,1999:blog-17487316.post5534984883775858803..comments2024-01-13T09:14:12.131+00:00Comments on The life of a Games Programmer: Speed UP! Slooooow down....Mikehttp://www.blogger.com/profile/15958965170878448339noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-17487316.post-64928551584760171292008-11-08T20:42:00.000+00:002008-11-08T20:42:00.000+00:00Ahhhh!! Much better!! Thanks guys! I do wish M$ w...Ahhhh!! Much better!! Thanks guys! <BR/><BR/>I do wish M$ would do the decent thing and fix GetTime()....Mikehttps://www.blogger.com/profile/15958965170878448339noreply@blogger.comtag:blogger.com,1999:blog-17487316.post-55893228316018290442008-11-08T20:34:00.000+00:002008-11-08T20:34:00.000+00:00Yep,... just figured this out too... Since frames ...Yep,... just figured this out too... Since frames were taking either 0ms or 15ms - which is classic windows GetTime() stuff.<BR/><BR/>I was just about to look for a better time so thanks for pointing me in the right direction! :)Mikehttps://www.blogger.com/profile/15958965170878448339noreply@blogger.comtag:blogger.com,1999:blog-17487316.post-20353642897156688602008-11-08T20:31:00.000+00:002008-11-08T20:31:00.000+00:00As a follow-up to that, this seems to be a Windows...As a follow-up to that, this seems to be a Windows thing, not a PC thing.<BR/><BR/>You should probably use System.nanoTime()/1000000 instead of System.currentTimeMillis().<BR/><BR/>Or don't use Windows.<BR/><BR/>See article:<BR/>http://www.simongbrown.com/blog/2007/08/20/millisecond_accuracy_in_java.htmlAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-17487316.post-25473528988016337772008-11-08T20:22:00.000+00:002008-11-08T20:22:00.000+00:00I think you might find that the current time in mi...I think you might find that the current time in milliseconds is not real-time, but rather has granularity issues.<BR/><BR/>You may recall from eons ago that the PC has a 16ms interrupt for the real-time clock (approx 65 times per second)... this is something which could have changed over the years but really didn't.<BR/><BR/>There is probably a much better interface to get the system time from, but as I recall it would rely on technologies that JAVA doesn't want to rely on.<BR/><BR/>Here's a test: write a loop which grabs the current time in milliseconds, and logs it; watching carefully for changes. I expect you'll see SAME, SAME, SAME, 16ms jump, SAME, etc.Anonymousnoreply@blogger.com