Skip to content

Commit

Permalink
Only show processor/memory consumption delta
Browse files Browse the repository at this point in the history
  • Loading branch information
runesoerensen committed May 29, 2012
1 parent b3d2ec5 commit 831e9d6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Core/Sandbox.cs
Expand Up @@ -43,13 +43,16 @@ private ExecutionResult Execute(string className, string resultProperty)

try
{
var totalProcessorTime = domain.MonitoringTotalProcessorTime;
var totalAllocatedMemorySize = domain.MonitoringTotalAllocatedMemorySize;

var loader = (ByteCodeLoader)domain.CreateInstanceAndUnwrap(type.Assembly.FullName, type.FullName);
var unformattedResult = loader.Run(className, resultProperty, _assemblyBytes);

result.Result = formatter.FormatObject(unformattedResult.ReturnValue);
result.ConsoleOutput = unformattedResult.ConsoleOutput;
result.ProcessorTime = domain.MonitoringTotalProcessorTime;
result.TotalMemoryAllocated = domain.MonitoringTotalAllocatedMemorySize;
result.ProcessorTime = domain.MonitoringTotalProcessorTime - totalProcessorTime;
result.TotalMemoryAllocated = domain.MonitoringTotalAllocatedMemorySize - totalAllocatedMemorySize;
}
catch (SerializationException ex)
{
Expand Down

0 comments on commit 831e9d6

Please sign in to comment.