tag:blogger.com,1999:blog-29331675.post6502173771328882811..comments2024-03-05T17:37:00.995+01:00Comments on The Delphi Geek: Calculating accurate 'Now'gabr42http://www.blogger.com/profile/06903558857617342477noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-29331675.post-20351757267036467972020-10-27T10:40:43.204+01:002020-10-27T10:40:43.204+01:00Hi. I did not red article until end, but on start ...Hi. I did not red article until end, but on start You are using sleep<br /> for i := 1 to 15 do begin<br /> Windows.GetSystemTime(st);<br /> outLog.Lines.Add(IntToStr(st.wMilliseconds));<br /> Sleep(1);<br /> end;<br />But SLEEP, not GetTime is quatified by approx 15 ms...<br />Example should look like this:<br /> for i := 1 to 15 do begin<br /> Windows.GetSystemTime(st1);<br /> repeat<br /> Windows.GetSystemTime(st2);<br /> until st2<>st1;<br /> outLog.Lines.Add(IntToStr(st.wMilliseconds));<br /> end;<br /><br />2nd issue is that (at least in current situation (WIN10, Delphi10) the NOW is REALLY quantized in 1 ms. (GetTick is 15ms as before) .Checked.<br /> for i := 1 to 50 do<br /> begin<br /> QueryPerformanceCounter(c1);<br /> n1 := now;<br /> repeat<br /> n2 := now;<br /> until n2 <> n1;<br /> QueryPerformanceCounter(C2);<br /> SL.Add((C2 - c1).ToString + ' / ' + FormatDateTime('ss.zzz', n2 - n1)); end;<br /><br />output looks like this:'9922 / 00.001' (my QueryPerformance Freq=10MHz.<br /><br />Can You correct misleading information in You article, please?<br />MartinKluvihttps://www.blogger.com/profile/02604498049486154003noreply@blogger.comtag:blogger.com,1999:blog-29331675.post-36575395106852099062009-12-29T17:44:12.881+01:002009-12-29T17:44:12.881+01:00Ah... thanks! :-)Ah... thanks! :-)Chee Menghttps://www.blogger.com/profile/04529680655322699177noreply@blogger.comtag:blogger.com,1999:blog-29331675.post-14155331358561761892009-12-28T13:22:12.798+01:002009-12-28T13:22:12.798+01:00Later I removed it because I couldn't make the...Later I removed it because I couldn't make the code to behave well in a multithreaded applications. Now I'm using much simpler approach. I've modified the article and attached current GpTime unit.gabr42https://www.blogger.com/profile/06903558857617342477noreply@blogger.comtag:blogger.com,1999:blog-29331675.post-72671013807810574142009-12-26T10:34:24.965+01:002009-12-26T10:34:24.965+01:00Hi gabr, sorry for 'resurrecting' an old p...Hi gabr, sorry for 'resurrecting' an old post... but I can't seem to find gpTime.zip anywhere, including http://17slon.com/gp/gp/files/ (unless it's hidden in one of the other zip files?)... could you please point me to the url where I can download it? Thanks! :-)Chee Menghttps://www.blogger.com/profile/04529680655322699177noreply@blogger.comtag:blogger.com,1999:blog-29331675.post-62431426583217154512008-02-12T07:55:00.000+01:002008-02-12T07:55:00.000+01:00I believe it wouldn't (run without compatibility i...I believe it wouldn't (run without compatibility issues), but I never tried it. I never used D7 (went from D5 to D2006 and then to D2007).gabr42https://www.blogger.com/profile/06903558857617342477noreply@blogger.comtag:blogger.com,1999:blog-29331675.post-22702487784549377982008-02-12T07:08:00.000+01:002008-02-12T07:08:00.000+01:00There are so much written about Vist but no clear ...There are so much written about Vist but no clear answers. Will a Delphi7 program written for XP run on Vista without any compatibility issues? yes or noAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-29331675.post-62414821426509504112007-11-28T11:25:00.000+01:002007-11-28T11:25:00.000+01:00Jolyon,It is the same, so you gave up the Pub and ...Jolyon,<BR/>It is the same, so you gave up the Pub and have gone to NZ?<BR/>I've sent an email to Deltics so we can leave this blog in peace.Neil Poultonhttps://www.blogger.com/profile/13799909978185906117noreply@blogger.comtag:blogger.com,1999:blog-29331675.post-48075006068711163912007-11-27T20:47:00.000+01:002007-11-27T20:47:00.000+01:00With apologies to this blog.....Neil Poulton? Is ...With apologies to this blog.....<BR/><BR/>Neil Poulton? Is that the same Neil Poulton that I worked with/alongside briefly at GSK back in the UK?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-29331675.post-92013317869637975472007-11-14T20:26:00.000+01:002007-11-14T20:26:00.000+01:00Thanks for that.TimeGetTime is a good GetTickCount...Thanks for that.<BR/>TimeGetTime is a good GetTickCount alternative. 1ms accuracy, fast to call and no affected by date time changes to computer.Neil Poultonhttps://www.blogger.com/profile/13799909978185906117noreply@blogger.com