Exemplo n.º 1
0
        public void Execute(ExecuteCommand command)
        {
            var stopwatch = command.IncludePerformance ? Stopwatch.StartNew() : null;

            _stdoutWriter.WriteOutputStart(command.OutputStartMarker);
            try {
                ExecuteAssembly(command.AssemblyBytes);
                _flowWriter.FlushAndReset();
                if (stopwatch != null)
                {
                    // TODO: Prettify
                    Console.Out.Write($"PERFORMANCE:");
                    Console.Out.Write($"\n  [VM] CONTAINER: {stopwatch.ElapsedMilliseconds,12}ms");
                }
            }
            catch (Exception ex) {
                try {
                    Output.Write(new SimpleInspection("Exception", ex.ToString()));
                    ContainerFlow.ReportException(ex);
                    _flowWriter.FlushAndReset();
                }
                catch {
                    Console.WriteLine(ex);
                }
            }
            _stdoutWriter.WriteOutputEnd(command.OutputEndMarker);
        }