Getting Time Elapsed

Index

    Getting Time Elapsed

    You can check how long it takes to validate an EDI file using the TimeElapsed property of the EDIValidator. The TimeElapsed property will give the number of milliseconds it took to validate the file. The first time the EDIValidator is used it will take a few more milliseconds because aside from validating the EDI file, the EDIValidator has to load the EDI rules. After the EDI rules are loaded it will take significantly less time to validate an EDI file.

    There are two ways to get the elapsed time. One way is through the TimeElapsed property. The other way is to subscribe to the ValidationComplete event args. It contains the Milliseconds property in its event args object.

    Example 1

    // Use the TimeElapsed property after validating the EDI file
    ediValidator.TimeElapsed;

    Example 2

    ediValidator.ValidationCompleted += new EDIValidator.ValidationCompletedEvent(ediValidator_ValidationCompleted);

    void ediValidator_ValidationCompleted(object sender, ValidationEventsArgs e)
    {
       MessageBox.Show(e.Milliseconds);
    }
    in EDI Validator
    Did this article answer your question?