Created
May 11, 2020 14:08
-
-
Save MikeCodesDotNET/589ad7d63869bbaab50f444febd96b6c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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