[Mono-bugs] [Bug 469907] New: Stopwatch.Elapsed overflow

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Jan 27 14:28:48 EST 2009


https://bugzilla.novell.com/show_bug.cgi?id=469907


           Summary: Stopwatch.Elapsed overflow
    Classification: Mono
           Product: Mono: Runtime
           Version: 2.0.x
          Platform: x86
        OS/Version: Windows Vista
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: misc
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: jan.siroky at rcware.eu
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.0; cs; rv:1.9.0.5)
Gecko/2008120122 Firefox/3.0.5 (.NET CLR 3.5.30729)

Stopwatch.Elapsed can handle just TimeSpan smaller than 2 days 03 hours 14
minutes and 27 seconds. If the ElapsedTicks value is bigger, the Elapsed
property overflows long type range. The Elapsed property get function follows:

return TimeSpan.FromTicks ((long)(TimeSpan.TicksPerSecond * ElapsedTicks /
Frequency));


Reproducible: Always

Steps to Reproduce:
For example, if Stopwatch runs for 2 days 03 hours 14 minutes and 28 seconds
then ElapsedTicks is 1844680000000. Let's now compute multiplication
TimeSpan.TicksPerSecond * ElapsedTicks: 1844680000000 * 10000000 = 18 446 800
000 000 000 000 that is bigger than long range: 18 446 744 073 709 551 615.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list