[LDTP-Dev] [Bug 415160] New: getElapsedTime counts mistaken time.

LDTP (bugzilla.gnome.org) bugzilla-daemon at bugzilla.gnome.org
Mon Mar 5 18:57:46 PST 2007


Do not reply to this via email (we are currently unable to handle email
responses and they get discarded).  You can add comments to this bug at
http://bugzilla.gnome.org/show_bug.cgi?id=415160

  LDTP | ldtprunner | Ver: 0.8.x

           Summary: getElapsedTime counts mistaken time.
           Product: LDTP
           Version: 0.8.x
          Platform: Other
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: ldtprunner
        AssignedTo: ldtp-maint at gnome.bugs
        ReportedBy: xygwf at hotmail.com
         QAContact: ldtp-dev at lists.freedesktop.org
     GNOME version: Unspecified
   GNOME milestone: Unspecified


The number of hour was error when _endTime great then 60.

Fixed here :)
def getElapsedTime (_endTime, _startTime):
    timeDiff = _endTime - _startTime
    hours = int (timeDiff / 3600)
    seconds = int (timeDiff - hours*3600)
    minutes = int (seconds / 60)
    seconds = int (seconds - minutes*60)
    days = 0
    fmt = ''
    if hours > 24:
        hours   = int (hours  % 24)
        days = int (hours / 24)
        fmt = str (days) + ' day(s) '
    fmt = fmt + str (hours) + ':' + str (minutes) + ':' + str (seconds)
    return fmt


-- 
Configure bugmail: http://bugzilla.gnome.org/userprefs.cgi?tab=email


More information about the LDTP-dev mailing list