Skip to content

Commit c79ad20

Browse files
authored
Merge pull request #1036 from The-OpenROAD-Project-staging/time-fix
Fix genElapsedTime.py
2 parents ec7740d + 7142fc7 commit c79ad20

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

flow/test/test_genElapsedTime.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def test_elapsed_time_longer_duration(self, mock_stdout):
4545
module = importlib.import_module(self.module_name)
4646
importlib.reload(module)
4747
# check if output is correct
48-
expected_output = "1_test 44654\n"
48+
expected_output = "1_test 744\n"
4949
self.assertEqual(mock_stdout.getvalue(), expected_output)
5050

5151
def test_missing_arg(self):
@@ -69,4 +69,4 @@ def tearDown(self):
6969
self.tmp_dir.cleanup()
7070

7171
if __name__ == '__main__':
72-
unittest.main()
72+
unittest.main()

flow/util/genElapsedTime.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
timePor = line.strip().replace('Elapsed time: ', '')
3636
# Remove the units from the time portion
3737
timePor = timePor.split('[h:]', 1)[0]
38-
# Ensure that hours, min and seconds are separated by ':' not '.'
39-
timePor = timePor.replace('.',':')
38+
# Remove any fraction of a second
39+
timePor = timePor.split('.', 1)[0]
4040
# Calculate elapsed time that has this format 'h:m:s'
4141
timeList = timePor.split(':')
4242
if len(timeList) == 2:

0 commit comments

Comments
 (0)