本文整理汇总了C#中ProtoCore.StartTimer方法的典型用法代码示例。如果您正苦于以下问题:C# ProtoCore.StartTimer方法的具体用法?C# ProtoCore.StartTimer怎么用?C# ProtoCore.StartTimer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProtoCore
的用法示例。
在下文中一共展示了ProtoCore.StartTimer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadAndExecute
public ExecutionMirror LoadAndExecute(string fileName, ProtoCore.Core core, bool isTest = true)
{
string codeContent = string.Empty;
try
{
using (System.IO.StreamReader reader = new System.IO.StreamReader(fileName, Encoding.UTF8, true))
{
codeContent = reader.ReadToEnd();
}
}
catch (System.IO.IOException)
{
throw new FatalError("Cannot open file " + fileName);
}
//Start the timer
core.StartTimer();
core.CurrentDSFileName = ProtoCore.Utils.FileUtils.GetFullPathName(fileName);
core.Options.RootModulePathName = core.CurrentDSFileName;
Execute(codeContent, core);
if (!core.Options.CompileToLib && (null != core.CurrentExecutive))
return new ExecutionMirror(core.CurrentExecutive.CurrentDSASMExec, core);
return null;
}
示例2: LoadAndExecute
public ExecutionMirror LoadAndExecute(string filename, ProtoCore.Core core, bool isTest = true)
{
System.IO.StreamReader reader = null;
try
{
reader = new System.IO.StreamReader(filename, Encoding.UTF8, true);
}
catch (System.IO.IOException)
{
throw new FatalError("Cannot open file " + filename);
}
string strSource = reader.ReadToEnd();
reader.Dispose();
//Start the timer
core.StartTimer();
core.Options.RootModulePathName = ProtoCore.Utils.FileUtils.GetFullPathName(filename);
core.CurrentDSFileName = core.Options.RootModulePathName;
ProtoLanguage.CompileStateTracker compileState = null;
Execute(strSource, core, out compileState);
if (isTest && !core.Options.CompileToLib)
return new ExecutionMirror(core.CurrentExecutive.CurrentDSASMExec, core);
else
return null;
}