Speeding up exceptions or my bad code

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Timothy Graves

    #1

    Speeding up exceptions or my bad code

    I have a quick (pun intended) question for the guru's out there.

    I have a piece of code where I am validating the input of chancters
    into a cell in a datagrid. I am using the keypressed event to get the
    charcter that the user typed and then allowing it to be passed to the
    cell. Now here is the tricked part, I am also validating the values
    (max and min) so that the user does not input a invalid number (out of
    range ex. byte != 256).

    Here is my code.

    //////START CODE//////

    DateTime begin = DateTime.Now;
    try
    {
    System.Convert. ToByte(tableDat aGrid.Controls[tableDataGrid.C urrentCell.Colu mnNumber
    + 2].Text + e.KeyChar);

    //This takes the current value in the cell (before editing has
    finished)
    //and appends the current pressed key and tries to convert it to a
    byte

    e.Handled = false;
    //if no exception is throwed then it is allowed to be sent to the
    cell
    }
    catch(System.Ov erflowException )
    {
    e.Handled = true;
    //if an exception does occur then it is not passed
    }
    DateTime end = DateTime.Now;

    info.Text = Convert.ToStrin g(end - begin);
    //just a multi line text box that I used for debugging and performance

    //////END CODE//////

    The reason that I am asking this is that exceptions are costly
    performance wise. This code in the block takes 2.2656250 seconds to
    be performed when an exception is thrown. But without one the ode
    executes too quickly to be timed (sp?).

    Do ya'll see any way to increase the speed of the exception or code.
    I'm up for anythng really.

    Thanks all

    Tim
  • Matt Garven

    #2
    Re: Speeding up exceptions or my bad code

    Avoid the exception altogether.

    string s = "255";
    double d = 0;
    byte b = 0;

    bool isValidNumber = Double.TryParse (s,
    System.Globaliz ation.NumberSty les.Integer, null, out d);
    e.Handled = !(isValidNumber && d >= 0 && d <= 255);

    Regards,
    Matt

    "Timothy Graves" <timothylg@hotm ail.com> wrote in message
    news:f03382a0.0 309232040.5c59d 4a7@posting.goo gle.com...[color=blue]
    > I have a quick (pun intended) question for the guru's out there.
    >
    > I have a piece of code where I am validating the input of chancters
    > into a cell in a datagrid. I am using the keypressed event to get the
    > charcter that the user typed and then allowing it to be passed to the
    > cell. Now here is the tricked part, I am also validating the values
    > (max and min) so that the user does not input a invalid number (out of
    > range ex. byte != 256).
    >
    > Here is my code.
    >
    > //////START CODE//////
    >
    > DateTime begin = DateTime.Now;
    > try
    > {
    >[/color]
    System.Convert. ToByte(tableDat aGrid.Controls[tableDataGrid.C urrentCell.Colu m
    nNumber[color=blue]
    > + 2].Text + e.KeyChar);
    >
    > //This takes the current value in the cell (before editing has
    > finished)
    > //and appends the current pressed key and tries to convert it to a
    > byte
    >
    > e.Handled = false;
    > //if no exception is throwed then it is allowed to be sent to the
    > cell
    > }
    > catch(System.Ov erflowException )
    > {
    > e.Handled = true;
    > //if an exception does occur then it is not passed
    > }
    > DateTime end = DateTime.Now;
    >
    > info.Text = Convert.ToStrin g(end - begin);
    > //just a multi line text box that I used for debugging and performance
    >
    > //////END CODE//////
    >
    > The reason that I am asking this is that exceptions are costly
    > performance wise. This code in the block takes 2.2656250 seconds to
    > be performed when an exception is thrown. But without one the ode
    > executes too quickly to be timed (sp?).
    >
    > Do ya'll see any way to increase the speed of the exception or code.
    > I'm up for anythng really.
    >
    > Thanks all
    >
    > Tim[/color]


    Comment

    • Matt Garven

      #3
      Re: Speeding up exceptions or my bad code

      quick refactor:

      e.Handled = !(isValidNumber && >= byte.MinValue && d <= byte.MaxValue);

      ;)

      Regards,
      Matt


      "Matt Garven" <matt@nooospam. com> wrote in message
      news:u$SFzslgDH A.2088@TK2MSFTN GP12.phx.gbl...[color=blue]
      > Avoid the exception altogether.
      >
      > string s = "255";
      > double d = 0;
      > byte b = 0;
      >
      > bool isValidNumber = Double.TryParse (s,
      > System.Globaliz ation.NumberSty les.Integer, null, out d);
      > e.Handled = !(isValidNumber && d >= 0 && d <= 255);
      >
      > Regards,
      > Matt
      >
      > "Timothy Graves" <timothylg@hotm ail.com> wrote in message
      > news:f03382a0.0 309232040.5c59d 4a7@posting.goo gle.com...[color=green]
      > > I have a quick (pun intended) question for the guru's out there.
      > >
      > > I have a piece of code where I am validating the input of chancters
      > > into a cell in a datagrid. I am using the keypressed event to get the
      > > charcter that the user typed and then allowing it to be passed to the
      > > cell. Now here is the tricked part, I am also validating the values
      > > (max and min) so that the user does not input a invalid number (out of
      > > range ex. byte != 256).
      > >
      > > Here is my code.
      > >
      > > //////START CODE//////
      > >
      > > DateTime begin = DateTime.Now;
      > > try
      > > {
      > >[/color]
      >[/color]
      System.Convert. ToByte(tableDat aGrid.Controls[tableDataGrid.C urrentCell.Colu m[color=blue]
      > nNumber[color=green]
      > > + 2].Text + e.KeyChar);
      > >
      > > //This takes the current value in the cell (before editing has
      > > finished)
      > > //and appends the current pressed key and tries to convert it to a
      > > byte
      > >
      > > e.Handled = false;
      > > //if no exception is throwed then it is allowed to be sent to the
      > > cell
      > > }
      > > catch(System.Ov erflowException )
      > > {
      > > e.Handled = true;
      > > //if an exception does occur then it is not passed
      > > }
      > > DateTime end = DateTime.Now;
      > >
      > > info.Text = Convert.ToStrin g(end - begin);
      > > //just a multi line text box that I used for debugging and performance
      > >
      > > //////END CODE//////
      > >
      > > The reason that I am asking this is that exceptions are costly
      > > performance wise. This code in the block takes 2.2656250 seconds to
      > > be performed when an exception is thrown. But without one the ode
      > > executes too quickly to be timed (sp?).
      > >
      > > Do ya'll see any way to increase the speed of the exception or code.
      > > I'm up for anythng really.
      > >
      > > Thanks all
      > >
      > > Tim[/color]
      >
      >[/color]


      Comment

      • Chris R. Timmons

        #4
        Re: Speeding up exceptions or my bad code

        timothylg@hotma il.com (Timothy Graves) wrote in
        news:f03382a0.0 309232040.5c59d 4a7@posting.goo gle.com:
        [color=blue]
        > I have a quick (pun intended) question for the guru's out there.
        >
        > I have a piece of code where I am validating the input of
        > chancters into a cell in a datagrid. I am using the keypressed
        > event to get the charcter that the user typed and then allowing
        > it to be passed to the cell. Now here is the tricked part, I am
        > also validating the values (max and min) so that the user does
        > not input a invalid number (out of range ex. byte != 256).
        >
        > Here is my code.
        >
        > //////START CODE//////
        >
        > DateTime begin = DateTime.Now;
        > try
        > {
        > System.Convert. ToByte(tableDat aGrid.Controls[tableDataGrid.C u
        > rrentCell.Colum nNumber
        > + 2].Text + e.KeyChar);
        >
        > //This takes the current value in the cell (before editing
        > has
        > finished)
        > //and appends the current pressed key and tries to convert
        > it to a
        > byte
        >
        > e.Handled = false;
        > //if no exception is throwed then it is allowed to be sent
        > to the
        > cell
        > }
        > catch(System.Ov erflowException )
        > {
        > e.Handled = true;
        > //if an exception does occur then it is not passed
        > }
        > DateTime end = DateTime.Now;
        >
        > info.Text = Convert.ToStrin g(end - begin);
        > //just a multi line text box that I used for debugging and
        > performance
        >
        > //////END CODE//////
        >
        > The reason that I am asking this is that exceptions are costly
        > performance wise. This code in the block takes 2.2656250
        > seconds to be performed when an exception is thrown. But
        > without one the ode executes too quickly to be timed (sp?).
        >
        > Do ya'll see any way to increase the speed of the exception or
        > code. I'm up for anythng really.[/color]

        Tim,

        To solve the speed problem, don't use exceptions at all. Simply
        filter each character and discard those that don't meet your
        criteria:

        // Character-level validation.
        // Allow only 0 thru 9.
        e.Handled = ((e.KeyChar < '0') || (e.KeyChar > '9'));

        I would suggest not testing the entire value after each keystroke.
        Instead, test it after the user tries to leave the field or submit
        the form (i.e. use field-level validation instead of character-level
        validation). The logic is much simpler, plus I've found that users
        are more comfortable with this approach, rather than getting an error
        message after each keystroke.

        Here's an article w/ code that makes field-level validation in
        WinForms much easier:


        r/default.aspx

        or TinyURL:

        http://tinyurl.com/ogmm


        Hope this helps.

        Chris.
        -------------
        C.R. Timmons Consulting, Inc.

        Comment

        • Jon Skeet

          #5
          Re: Speeding up exceptions or my bad code

          Timothy Graves <timothylg@hotm ail.com> wrote:[color=blue]
          > I have a quick (pun intended) question for the guru's out there.
          >
          > I have a piece of code where I am validating the input of chancters
          > into a cell in a datagrid. I am using the keypressed event to get the
          > charcter that the user typed and then allowing it to be passed to the
          > cell. Now here is the tricked part, I am also validating the values
          > (max and min) so that the user does not input a invalid number (out of
          > range ex. byte != 256).[/color]

          <snip>

          As well as avoiding the exception by using other validation code, it's
          worth knowing why the exception is taking so long. (You should also be
          catching FormatException , by the way.)

          <snip>
          [color=blue]
          > The reason that I am asking this is that exceptions are costly
          > performance wise. This code in the block takes 2.2656250 seconds to
          > be performed when an exception is thrown. But without one the ode
          > executes too quickly to be timed (sp?).[/color]

          2 seconds is a very long time for an exception to take. What I suspect
          is happening is that the first time *any* exception is thrown, other
          assemblies are loaded to support that. Unfortunately I can't reproduce
          the problem - I ran this program:

          using System;

          class Test
          {
          public static void Main(string[] args)
          {
          for (int i=0; i < 5; i++)
          {
          DateTime start = DateTime.Now;
          try
          {
          Convert.ToByte( "-10");
          }
          catch (OverflowExcept ion)
          {
          }
          DateTime end = DateTime.Now;
          Console.WriteLi ne (end-start);
          }
          }
          }

          and the first time it ran, the first exception took 1/10th of a second,
          all the rest being almost instantaneous. After that, all runs gave
          almost instantaneous results.

          What does the above do on your computer?

          --
          Jon Skeet - <skeet@pobox.co m>
          Pobox has been discontinued as a separate service, and all existing customers moved to the Fastmail platform.

          If replying to the group, please do not mail me too

          Comment

          • Timothy Graves

            #6
            Re: Speeding up exceptions or my bad code

            I ran your program compile with .net framework 1.1 (VS 2003) and here
            was my results:

            00:00:02.312500 0
            00:00:00
            00:00:00
            00:00:00
            00:00:00

            When I ran it under 1.0 (VS 2002)

            00:00:00.125000 0
            00:00:00
            00:00:00.015625 0
            00:00:00
            00:00:00

            I have no idea what could have caused this. I also tried it in
            sharpdevelop (with 1.1) and it was just like VS 2002.

            Well any way that got me stumped.

            Jon Skeet <skeet@pobox.co m> wrote in message news:<MPG.19db5 8cbf743b3279897 3b@news.microso ft.com>...[color=blue]
            > Timothy Graves <timothylg@hotm ail.com> wrote:[color=green]
            > > I have a quick (pun intended) question for the guru's out there.
            > >
            > > I have a piece of code where I am validating the input of chancters
            > > into a cell in a datagrid. I am using the keypressed event to get the
            > > charcter that the user typed and then allowing it to be passed to the
            > > cell. Now here is the tricked part, I am also validating the values
            > > (max and min) so that the user does not input a invalid number (out of
            > > range ex. byte != 256).[/color]
            >
            > <snip>
            >
            > As well as avoiding the exception by using other validation code, it's
            > worth knowing why the exception is taking so long. (You should also be
            > catching FormatException , by the way.)
            >
            > <snip>
            >[color=green]
            > > The reason that I am asking this is that exceptions are costly
            > > performance wise. This code in the block takes 2.2656250 seconds to
            > > be performed when an exception is thrown. But without one the ode
            > > executes too quickly to be timed (sp?).[/color]
            >
            > 2 seconds is a very long time for an exception to take. What I suspect
            > is happening is that the first time *any* exception is thrown, other
            > assemblies are loaded to support that. Unfortunately I can't reproduce
            > the problem - I ran this program:
            >
            > using System;
            >
            > class Test
            > {
            > public static void Main(string[] args)
            > {
            > for (int i=0; i < 5; i++)
            > {
            > DateTime start = DateTime.Now;
            > try
            > {
            > Convert.ToByte( "-10");
            > }
            > catch (OverflowExcept ion)
            > {
            > }
            > DateTime end = DateTime.Now;
            > Console.WriteLi ne (end-start);
            > }
            > }
            > }
            >
            > and the first time it ran, the first exception took 1/10th of a second,
            > all the rest being almost instantaneous. After that, all runs gave
            > almost instantaneous results.
            >
            > What does the above do on your computer?[/color]

            Comment

            • Timothy Graves

              #7
              Re: Speeding up exceptions or my bad code

              I ran your program compile with .net framework 1.1 (VS 2003) and here
              was my results:

              00:00:02.312500 0
              00:00:00
              00:00:00
              00:00:00
              00:00:00

              When I ran it under 1.0 (VS 2002)

              00:00:00.125000 0
              00:00:00
              00:00:00.015625 0
              00:00:00
              00:00:00

              I have no idea what could have caused this. I also tried it in
              sharpdevelop (with 1.1) and it was just like VS 2002.

              Well any way that got me stumped.

              Jon Skeet <skeet@pobox.co m> wrote in message news:<MPG.19db5 8cbf743b3279897 3b@news.microso ft.com>...[color=blue]
              > Timothy Graves <timothylg@hotm ail.com> wrote:[color=green]
              > > I have a quick (pun intended) question for the guru's out there.
              > >
              > > I have a piece of code where I am validating the input of chancters
              > > into a cell in a datagrid. I am using the keypressed event to get the
              > > charcter that the user typed and then allowing it to be passed to the
              > > cell. Now here is the tricked part, I am also validating the values
              > > (max and min) so that the user does not input a invalid number (out of
              > > range ex. byte != 256).[/color]
              >
              > <snip>
              >
              > As well as avoiding the exception by using other validation code, it's
              > worth knowing why the exception is taking so long. (You should also be
              > catching FormatException , by the way.)
              >
              > <snip>
              >[color=green]
              > > The reason that I am asking this is that exceptions are costly
              > > performance wise. This code in the block takes 2.2656250 seconds to
              > > be performed when an exception is thrown. But without one the ode
              > > executes too quickly to be timed (sp?).[/color]
              >
              > 2 seconds is a very long time for an exception to take. What I suspect
              > is happening is that the first time *any* exception is thrown, other
              > assemblies are loaded to support that. Unfortunately I can't reproduce
              > the problem - I ran this program:
              >
              > using System;
              >
              > class Test
              > {
              > public static void Main(string[] args)
              > {
              > for (int i=0; i < 5; i++)
              > {
              > DateTime start = DateTime.Now;
              > try
              > {
              > Convert.ToByte( "-10");
              > }
              > catch (OverflowExcept ion)
              > {
              > }
              > DateTime end = DateTime.Now;
              > Console.WriteLi ne (end-start);
              > }
              > }
              > }
              >
              > and the first time it ran, the first exception took 1/10th of a second,
              > all the rest being almost instantaneous. After that, all runs gave
              > almost instantaneous results.
              >
              > What does the above do on your computer?[/color]

              Comment

              • Timothy Graves

                #8
                Re: Speeding up exceptions or my bad code

                I think you are right. I was getting a little too ambitious.

                Thanks Chris,

                Tim

                "Chris R. Timmons" <crtimmons@X_NO SPAM_Xcrtimmons inc.com> wrote in message news:<Xns9400C1 3985CEcrtimmons crtimmonsin@207 .46.248.16>...[color=blue]
                > timothylg@hotma il.com (Timothy Graves) wrote in
                > news:f03382a0.0 309232040.5c59d 4a7@posting.goo gle.com:
                >[color=green]
                > > I have a quick (pun intended) question for the guru's out there.
                > >
                > > I have a piece of code where I am validating the input of
                > > chancters into a cell in a datagrid. I am using the keypressed
                > > event to get the charcter that the user typed and then allowing
                > > it to be passed to the cell. Now here is the tricked part, I am
                > > also validating the values (max and min) so that the user does
                > > not input a invalid number (out of range ex. byte != 256).
                > >
                > > Here is my code.
                > >
                > > //////START CODE//////
                > >
                > > DateTime begin = DateTime.Now;
                > > try
                > > {
                > > System.Convert. ToByte(tableDat aGrid.Controls[tableDataGrid.C u
                > > rrentCell.Colum nNumber
                > > + 2].Text + e.KeyChar);
                > >
                > > //This takes the current value in the cell (before editing
                > > has
                > > finished)
                > > //and appends the current pressed key and tries to convert
                > > it to a
                > > byte
                > >
                > > e.Handled = false;
                > > //if no exception is throwed then it is allowed to be sent
                > > to the
                > > cell
                > > }
                > > catch(System.Ov erflowException )
                > > {
                > > e.Handled = true;
                > > //if an exception does occur then it is not passed
                > > }
                > > DateTime end = DateTime.Now;
                > >
                > > info.Text = Convert.ToStrin g(end - begin);
                > > //just a multi line text box that I used for debugging and
                > > performance
                > >
                > > //////END CODE//////
                > >
                > > The reason that I am asking this is that exceptions are costly
                > > performance wise. This code in the block takes 2.2656250
                > > seconds to be performed when an exception is thrown. But
                > > without one the ode executes too quickly to be timed (sp?).
                > >
                > > Do ya'll see any way to increase the speed of the exception or
                > > code. I'm up for anythng really.[/color]
                >
                > Tim,
                >
                > To solve the speed problem, don't use exceptions at all. Simply
                > filter each character and discard those that don't meet your
                > criteria:
                >
                > // Character-level validation.
                > // Allow only 0 thru 9.
                > e.Handled = ((e.KeyChar < '0') || (e.KeyChar > '9'));
                >
                > I would suggest not testing the entire value after each keystroke.
                > Instead, test it after the user tries to leave the field or submit
                > the form (i.e. use field-level validation instead of character-level
                > validation). The logic is much simpler, plus I've found that users
                > are more comfortable with this approach, rather than getting an error
                > message after each keystroke.
                >
                > Here's an article w/ code that makes field-level validation in
                > WinForms much easier:
                >
                > http://www.ftponline.com/vsm/2002_11...esktopdevelope
                > r/default.aspx
                >
                > or TinyURL:
                >
                > http://tinyurl.com/ogmm
                >
                >
                > Hope this helps.
                >
                > Chris.
                > -------------
                > C.R. Timmons Consulting, Inc.
                > http://www.crtimmonsinc.com/[/color]

                Comment

                • Timothy Graves

                  #9
                  Re: Speeding up exceptions or my bad code

                  I think you are right. I was getting a little too ambitious.

                  Thanks Chris,

                  Tim

                  "Chris R. Timmons" <crtimmons@X_NO SPAM_Xcrtimmons inc.com> wrote in message news:<Xns9400C1 3985CEcrtimmons crtimmonsin@207 .46.248.16>...[color=blue]
                  > timothylg@hotma il.com (Timothy Graves) wrote in
                  > news:f03382a0.0 309232040.5c59d 4a7@posting.goo gle.com:
                  >[color=green]
                  > > I have a quick (pun intended) question for the guru's out there.
                  > >
                  > > I have a piece of code where I am validating the input of
                  > > chancters into a cell in a datagrid. I am using the keypressed
                  > > event to get the charcter that the user typed and then allowing
                  > > it to be passed to the cell. Now here is the tricked part, I am
                  > > also validating the values (max and min) so that the user does
                  > > not input a invalid number (out of range ex. byte != 256).
                  > >
                  > > Here is my code.
                  > >
                  > > //////START CODE//////
                  > >
                  > > DateTime begin = DateTime.Now;
                  > > try
                  > > {
                  > > System.Convert. ToByte(tableDat aGrid.Controls[tableDataGrid.C u
                  > > rrentCell.Colum nNumber
                  > > + 2].Text + e.KeyChar);
                  > >
                  > > //This takes the current value in the cell (before editing
                  > > has
                  > > finished)
                  > > //and appends the current pressed key and tries to convert
                  > > it to a
                  > > byte
                  > >
                  > > e.Handled = false;
                  > > //if no exception is throwed then it is allowed to be sent
                  > > to the
                  > > cell
                  > > }
                  > > catch(System.Ov erflowException )
                  > > {
                  > > e.Handled = true;
                  > > //if an exception does occur then it is not passed
                  > > }
                  > > DateTime end = DateTime.Now;
                  > >
                  > > info.Text = Convert.ToStrin g(end - begin);
                  > > //just a multi line text box that I used for debugging and
                  > > performance
                  > >
                  > > //////END CODE//////
                  > >
                  > > The reason that I am asking this is that exceptions are costly
                  > > performance wise. This code in the block takes 2.2656250
                  > > seconds to be performed when an exception is thrown. But
                  > > without one the ode executes too quickly to be timed (sp?).
                  > >
                  > > Do ya'll see any way to increase the speed of the exception or
                  > > code. I'm up for anythng really.[/color]
                  >
                  > Tim,
                  >
                  > To solve the speed problem, don't use exceptions at all. Simply
                  > filter each character and discard those that don't meet your
                  > criteria:
                  >
                  > // Character-level validation.
                  > // Allow only 0 thru 9.
                  > e.Handled = ((e.KeyChar < '0') || (e.KeyChar > '9'));
                  >
                  > I would suggest not testing the entire value after each keystroke.
                  > Instead, test it after the user tries to leave the field or submit
                  > the form (i.e. use field-level validation instead of character-level
                  > validation). The logic is much simpler, plus I've found that users
                  > are more comfortable with this approach, rather than getting an error
                  > message after each keystroke.
                  >
                  > Here's an article w/ code that makes field-level validation in
                  > WinForms much easier:
                  >
                  > http://www.ftponline.com/vsm/2002_11...esktopdevelope
                  > r/default.aspx
                  >
                  > or TinyURL:
                  >
                  > http://tinyurl.com/ogmm
                  >
                  >
                  > Hope this helps.
                  >
                  > Chris.
                  > -------------
                  > C.R. Timmons Consulting, Inc.
                  > http://www.crtimmonsinc.com/[/color]

                  Comment

                  • Matt

                    #10
                    Re: Speeding up exceptions or my bad code

                    timothylg@hotma il.com (Timothy Graves) wrote in message news:<f03382a0. 0309241741.2825 0523@posting.go ogle.com>...[color=blue]
                    > I ran your program compile with .net framework 1.1 (VS 2003) and here
                    > was my results:
                    >
                    > 00:00:02.312500 0
                    > 00:00:00
                    > 00:00:00
                    > 00:00:00
                    > 00:00:00
                    >
                    > When I ran it under 1.0 (VS 2002)
                    >
                    > 00:00:00.125000 0
                    > 00:00:00
                    > 00:00:00.015625 0
                    > 00:00:00
                    > 00:00:00
                    >
                    > I have no idea what could have caused this. I also tried it in
                    > sharpdevelop (with 1.1) and it was just like VS 2002.
                    >
                    > Well any way that got me stumped.[/color]

                    I take it you're running this from within Visual Studio, as opposed to
                    running the .exe directly? Try selecting Debug -> Start Without
                    Debugging from the menu and see what the timings are then.

                    Comment

                    • Timothy Graves

                      #11
                      Re: Speeding up exceptions or my bad code

                      ktrvnbq02@sneak email.com (Matt) wrote in message news:<553872e9. 0309250640.987f bdc@posting.goo gle.com>...[color=blue]
                      > timothylg@hotma il.com (Timothy Graves) wrote in message news:<f03382a0. 0309241741.2825 0523@posting.go ogle.com>...[color=green]
                      > > I ran your program compile with .net framework 1.1 (VS 2003) and here
                      > > was my results:
                      > >
                      > > 00:00:02.312500 0
                      > > 00:00:00
                      > > 00:00:00
                      > > 00:00:00
                      > > 00:00:00
                      > >
                      > > When I ran it under 1.0 (VS 2002)
                      > >
                      > > 00:00:00.125000 0
                      > > 00:00:00
                      > > 00:00:00.015625 0
                      > > 00:00:00
                      > > 00:00:00
                      > >
                      > > I have no idea what could have caused this. I also tried it in
                      > > sharpdevelop (with 1.1) and it was just like VS 2002.
                      > >
                      > > Well any way that got me stumped.[/color]
                      >
                      > I take it you're running this from within Visual Studio, as opposed to
                      > running the .exe directly? Try selecting Debug -> Start Without
                      > Debugging from the menu and see what the timings are then.[/color]

                      That did it, the exception runs almost at zero now.

                      Thanks for figuring that out for me

                      Tim

                      Comment

                      Working...