Ran Dan's test code on latest Windows PE version of Universe and got :- 9.788 1.558 1.474 3.412 Tried NOT(MOD(YEAR,400)) OR(NOT(MOD(YEAR,4)) ANDMOD(YEAR,100))) which took 1.423 seconds Got the same trend, although different timings on our Solaris 10 box running Universe 10.3.6 Cheers, Andy From: Daniel McGrath <[email protected]> To: "[email protected]" <[email protected]>; U2 Users List <[email protected]> Sent: Wednesday, 7 December 2011, 18:57 Subject: Re: [U2] End of Month date routine
I added the code to PasteBin so as to not flood here: http://pastebin.com/JMyqhFud I did a few more than 100K and I cut the OCONV step out from all of them. I took the liberty to adjust Will's version to return correct results. The results I got, in order, was: 16.872 2.804 2.384 5.561 So, if you have a need to account for your milliseconds, the slightly optimized Wikipedia algorithm seems to be the fastest. Interested to see if there are any better? (Or if I made any mistakes...) Regards, Dan -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of David A. Green Sent: Wednesday, December 07, 2011 10:48 AM To: 'U2 Users List' Subject: Re: [U2] End of Month date routine Who wants to take each of the Leap Year calculations and put them into different subroutines and loop 100K times and see which one is faster using profiling? David A. Green (480) 813-1725 DAG Consulting _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users LEAP.YEAR = ( which took 2.181 seconds but the fastest I could get at the moment is LEAP.YEAR = NOT(MOD(YEAR,4))IFLEAP.YEAR THEN LEAP.YEAR = (NOT(MOD(YEAR,400)) ORMOD(YEAR,100))END _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users
