|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Thursday, May 02, 2013 5:38 AM
Points: 870,
Visits: 858
|
|
I get 3.3 ms here using your own code.
The worst part about it is you would have not given the job to someone who correctly responded with 3.3ms for GETDATE() precision
Karl source control for SQL Server
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Friday, April 05, 2013 8:40 AM
Points: 907,
Visits: 173
|
|
If you get 15.6521 it does not mean that this is the precision of getdate()!
Why do you think that @Time and @TimeEnd have succesiv values?
The conclusion, in my opinion, is the your system is very good (count is only 595 so only 595 times @Time and @TimeEnd are different, on my system is gets 18475), but the load of you system is very high, your processor is taken by another process from time to time so you get a very big value for the "precision" (in my case is 3.34344).
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, March 03, 2011 5:58 AM
Points: 7,
Visits: 22
|
|
matthieu.ravard (5/12/2010) is the other instructions present in the code takes some millisecond ?
Doesn't matter as long as you get several loop iterations before the timer gives another value.
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Tuesday, February 19, 2013 2:02 AM
Points: 846,
Visits: 303
|
|
WIN XP SP3 / SQL Server 2008 SP1 on dual core machine
getdate: 6043 3.3399 & 5957 3.33557 sysdatetime: 1713 15625 & 1789 15625
Regards,
Willem http://wschampheleer.wordpress.com
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Thursday, February 09, 2012 4:42 AM
Points: 29,
Visits: 396
|
|
My results on a single Windows 2000 Professional SP4 machine: - In SQL Server 2000 Query Analyzer: did not run within 5 minutes runtime, I do not understand why. - In SQL Server 2000 SP4, via Access .ADP file: 1,418 / 15.62, - In SQL Server 2005 SP2, via Access .ADP file: 789 / 15.62.
Hope, this adds to the discussion, Leendert.
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Thursday, February 09, 2012 4:42 AM
Points: 29,
Visits: 396
|
|
P.S. I was too impatient: the very same Windows 2000 Professional SP4 machine, SQL Server 2000 Query Analyzer, after 7:44 minutes: 27,553 / 16.8266. The Access .ADP file return results after 12–22 sec.
I stop trying to understand all these differences, Leendert.
|
|
|
|
|
Valued Member
      
Group: General Forum Members
Last Login: Yesterday @ 9:15 AM
Points: 56,
Visits: 487
|
|
From my XP workstation, running the first query only, if I connect to my local SQL 2008 install then I get the 3.3333 time. If I connect to our Server's SQL 2005 install, I get the 15.6xxx time.
Just wanted to share my experience.
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Tuesday, March 29, 2011 2:59 PM
Points: 473,
Visits: 606
|
|
Wow. I did not expect to get so many posts before I even show up for work. Looking at all the replies, one potential explanation for some of the 'better' precision numbers for GETDATE() might be possible. 64 bit OS. Looks like whoever run the tests on 64 bit OS got the 3.33 ms precision and whoever run it on 32 bit got ~16 ms presicion.
If anyone of you got the 3.33 ms on a 32 bit box please reply with more specifics on the OS, CPU and SQL Server version. I don't think anything else could explain the difference. I did to run the tests on different configurations but I have to admit I did not have access to a 64 bit OS.
--------------------------------------------- Nothing is impossible. It is just a matter of time and money.
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Tuesday, February 19, 2013 2:02 AM
Points: 846,
Visits: 303
|
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Tuesday, March 29, 2011 2:59 PM
Points: 473,
Visits: 606
|
|
SQLZ (5/12/2010)
I get 3.3 ms here using your own code. The worst part about it is you would have not given the job to someone who correctly responded with 3.3ms for GETDATE() precision 
Well, life is tough.
But seriously, back then, when I was in the position to interview people I did not care as much what knowledge did they have but rather what could they do with it.
--------------------------------------------- Nothing is impossible. It is just a matter of time and money.
|
|
|
|