|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
ISDATE() took 8 seconds to complete ?I have code as below. Question: The 8 seconds only occured on the 1st time the code run. If I click the button again , the interval become smaller than 1 seconds. This sympton occured on multiple development PC that run the .NET 2003. Any idea why is that ? * Code : Private Sub btnTiming_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTiming.Click Dim blnResult As Boolean Debug.WriteLine("start time: " & Now()) blnResult = IsDate("88/88/8888") Debug.WriteLine("end time: " & Now()) End Sub * Output Result show: start time: 8/15/2006 5:32:14 PM end time: 8/15/2006 5:32:22 PM MT,
| Any idea The benefits (and also pitfalls) of JIT compiling.| why is that ? Remember that VB.NET creates MSIL code. At run time the CLR converts your MSIL code into executable code the first time you execute a routine. Subsequent calls to that routine will be faster as the JIT itself has already been complete. NOTE: The JIT steps occurs each time you execute the program. You can use NGEN to pre-JIT your assembly, however I understand that a JIT still occurs... -- Show quoteHide quoteHope this helps Jay B. Harlow [MVP - Outlook] ..NET Application Architect, Enthusiast, & Evangelist T.S. Bradley - http://www.tsbradley.net "MT" <sales_nospam@mft.com> wrote in message news:%23JLO9JLwGHA.2260@TK2MSFTNGP03.phx.gbl... | Platform : VB.NET 2003 | I have code as below. | Question: The 8 seconds only occured on the 1st time the code run. If I | click the button again , the interval become smaller than 1 seconds. This | sympton occured on multiple development PC that run the .NET 2003. Any idea | why is that ? | | * Code : | | Private Sub btnTiming_Click(ByVal sender As System.Object, ByVal e As | System.EventArgs) Handles btnTiming.Click | Dim blnResult As Boolean | | Debug.WriteLine("start time: " & Now()) | blnResult = IsDate("88/88/8888") | Debug.WriteLine("end time: " & Now()) | | End Sub | | * Output Result show: | start time: 8/15/2006 5:32:14 PM | end time: 8/15/2006 5:32:22 PM | | | | MT,
That is because in VBNet 2003 the ISDate is using the standard error try catch mechanisme inside. Therefore that time is only the first time taking so much time. This is now changed with a TryCast in VB2005, therefore this behaviour should be changed also in the VB2005 version. However the time you call is extremely long, is this done on an slow processor? I hope this gives an idea, Cor Show quoteHide quote "MT" <sales_nospam@mft.com> schreef in bericht news:%23JLO9JLwGHA.2260@TK2MSFTNGP03.phx.gbl... > Platform : VB.NET 2003 > I have code as below. > Question: The 8 seconds only occured on the 1st time the code run. If I > click the button again , the interval become smaller than 1 seconds. This > sympton occured on multiple development PC that run the .NET 2003. Any > idea why is that ? > > * Code : > > Private Sub btnTiming_Click(ByVal sender As System.Object, ByVal e As > System.EventArgs) Handles btnTiming.Click > Dim blnResult As Boolean > > Debug.WriteLine("start time: " & Now()) > blnResult = IsDate("88/88/8888") > Debug.WriteLine("end time: " & Now()) > > End Sub > > * Output Result show: > start time: 8/15/2006 5:32:14 PM > end time: 8/15/2006 5:32:22 PM > > > > |
|||||||||||||||||||||||