Skip to content

Commit d918129

Browse files
committed
some time tracing support to help optimise startup time
1 parent b34640a commit d918129

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main/groovy/bpipe/Runner.groovy

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
package bpipe
2727

2828
import java.nio.channels.FileLock
29+
import java.time.LocalTime
30+
import java.time.format.DateTimeFormatter
2931
import java.util.logging.ConsoleHandler
3032
import java.util.logging.FileHandler
3133
import java.util.logging.Handler;
@@ -156,7 +158,11 @@ class Runner {
156158
@CompileStatic
157159
public static void main(String [] arguments) {
158160

159-
161+
if(System.properties.bpipe_show_timings == 'true') {
162+
LocalTime now = LocalTime.now();
163+
DateTimeFormatter fmt = DateTimeFormatter.ofPattern("mm:ss.nnnnnnnnn");
164+
System.out.println(now.format(fmt) + " main");
165+
}
160166

161167
List<String> args = arguments as List<String>
162168

0 commit comments

Comments
 (0)