Skip to content

Instantly share code, notes, and snippets.

@MikeCodesDotNET
Created May 11, 2020 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MikeCodesDotNET/589ad7d63869bbaab50f444febd96b6c to your computer and use it in GitHub Desktop.
Save MikeCodesDotNET/589ad7d63869bbaab50f444febd96b6c to your computer and use it in GitHub Desktop.
static Script script;
public static async Task Main(string[] args)
{
var userScriptPath = Path.Combine(Environment.CurrentDirectory, "scriptInput.txt");
var fileContents = File.ReadAllText(userScriptPath);
script = CSharpScript.Create(fileContents, ScriptOptions.Default);
for (int i = 0; i < 15; i++)
{
var result = await script.RunAsync();
Console.WriteLine($"{i} - Seconds in a week: {result.GetVariable("seconds").Value}");
await Task.Delay(500);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment