private void runButton_Click(object sender, EventArgs e) { var text = scriptInputBox.Text; var sw = new Stopwatch(); var runner = new Thread(() => { try { SetStatus("Running"); sw.Start(); var coreTime = Repl.BuildAndRun(text, streamIn, streamOut, traceCheckbox.Checked, showBytecodeCheck.Checked, memTraceCheckBox.Checked); sw.Stop(); SetStatus("Complete: " + sw.Elapsed + " (execution: " + coreTime + ")"); } catch (Exception ex) { MessageBox.Show(ex.Message, "REPL error"); } }) { IsBackground = true }; runner.Start(); }