Changeset 86918 in vbox
- Timestamp:
- Nov 19, 2020 11:08:06 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/common/utils.py
r86588 r86918 1578 1578 sTime = sTime[1:]; 1579 1579 1580 # HH:MM :SS1580 # HH:MM[:SS] 1581 1581 iHour = int(sTime[0:2]); 1582 1582 assert(sTime[2] == ':'); 1583 1583 iMin = int(sTime[3:5]); 1584 assert(sTime[5] == ':'); 1585 iSec = int(sTime[6:8]); 1586 1587 # Fraction? 1588 offTime = 8; 1589 iMicroseconds = 0; 1590 if offTime < len(sTime) and sTime[offTime] in '.,': 1591 offTime += 1; 1592 cchFraction = 0; 1593 while offTime + cchFraction < len(sTime) and sTime[offTime + cchFraction] in '0123456789': 1594 cchFraction += 1; 1595 if cchFraction > 0: 1596 iMicroseconds = int(sTime[offTime : (offTime + cchFraction)]); 1597 offTime += cchFraction; 1598 while cchFraction < 6: 1599 iMicroseconds *= 10; 1584 if (sTime[5] == ':') 1585 iSec = int(sTime[6:8]); 1586 1587 # Fraction? 1588 offTime = 8; 1589 iMicroseconds = 0; 1590 if offTime < len(sTime) and sTime[offTime] in '.,': 1591 offTime += 1; 1592 cchFraction = 0; 1593 while offTime + cchFraction < len(sTime) and sTime[offTime + cchFraction] in '0123456789': 1600 1594 cchFraction += 1; 1601 while cchFraction > 6: 1602 iMicroseconds = iMicroseconds // 10; 1603 cchFraction -= 1; 1595 if cchFraction > 0: 1596 iMicroseconds = int(sTime[offTime : (offTime + cchFraction)]); 1597 offTime += cchFraction; 1598 while cchFraction < 6: 1599 iMicroseconds *= 10; 1600 cchFraction += 1; 1601 while cchFraction > 6: 1602 iMicroseconds = iMicroseconds // 10; 1603 cchFraction -= 1; 1604 1605 else: 1606 iSec = 0; 1607 iMicroseconds = 0; 1608 offTime = 5; 1604 1609 1605 1610 # Naive?
Note:
See TracChangeset
for help on using the changeset viewer.