mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-23 02:35:55 +08:00
Merge branch 'GP-0_ryanmkurtz_PR-8915_belmegatron_getTaskTimesString'
(Closes #8915, Closes #8914)
This commit is contained in:
+8
-13
@@ -4,9 +4,9 @@
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@@ -1183,18 +1183,15 @@ public class AutoAnalysisManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the time taken by a named task
|
||||
* The names of tasks that have run can be retrieved using getTimedTasks
|
||||
* {@return the time taken by a named task, or {@code -1} if the named task could not be found}
|
||||
* <p>
|
||||
* The names of tasks that have run can be retrieved using {@link #getTimedTasks()}.
|
||||
*
|
||||
* @param map the times by task names
|
||||
* @param taskName the task name
|
||||
* @return the time taken by a named task
|
||||
*/
|
||||
public long getTaskTime(Map<String, Long> map, String taskName) {
|
||||
Long time = map.get(taskName);
|
||||
if (time == null) {
|
||||
return -1;
|
||||
}
|
||||
return time.longValue();
|
||||
return map.getOrDefault(taskName, -1L);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1249,9 +1246,7 @@ public class AutoAnalysisManager {
|
||||
long taskTime = getTaskTime(timedTasks, element);
|
||||
double totalTime = taskTime / 1000.00;
|
||||
|
||||
String partTime = (((int) (totalTime * 1000.0)) % 1000) + "";
|
||||
String secString =
|
||||
((int) totalTime) + "." + "000".substring(partTime.length()) + partTime + " secs";
|
||||
String secString = String.format("%.3f secs", totalTime);
|
||||
int testLen = element.length() + secString.length();
|
||||
if (testLen > spacer.length()) {
|
||||
testLen = spacer.length() - 5;
|
||||
|
||||
Reference in New Issue
Block a user