GP-0: Adding some timing messages

This commit is contained in:
Ryan Kurtz 2024-04-12 08:51:31 -04:00
parent d04b285f8d
commit 27985d755b
4 changed files with 20 additions and 7 deletions

View file

@ -17,6 +17,8 @@ package ghidra;
import java.io.*;
import java.lang.reflect.Constructor;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
import java.util.*;
import java.util.stream.Collectors;
@ -35,6 +37,8 @@ import utility.module.ModuleUtilities;
*/
public class GhidraLauncher {
private static Instant START_INSTANT = Instant.now();
/**
* Launches the given {@link GhidraLaunchable} specified in the first command line argument
*
@ -46,7 +50,6 @@ public class GhidraLauncher {
*/
public static void launch(String[] args) throws Exception {
// Initialize the Ghidra environment
GhidraApplicationLayout layout = initializeGhidraEnvironment();
// Make sure the thing to launch meets the criteria:
@ -93,6 +96,13 @@ public class GhidraLauncher {
launch(args);
}
/**
* {@return the current number of milliseconds that have elapsed since execution began}
*/
public static long getMillisecondsFromLaunch() {
return ChronoUnit.MILLIS.between(START_INSTANT, Instant.now());
}
/**
* Initializes the Ghidra environment by discovering its {@link GhidraApplicationLayout layout}
* and adding all relevant modules and libraries to the classpath