private void Convert(string infile, string outfile, ILogger logger = null) { using (var chrome = new ChromeProcess()) { chrome.EnsureRunning(); ConvertWithProcess(chrome, infile, outfile); } }
public void StressTest() { using (var chrome = new ChromeProcess()) { chrome.EnsureRunning(); var infile = Guid.NewGuid() + ".xml"; infile = Path.Combine(Path.GetTempPath(), infile); File.WriteAllText(infile, _xmlFileContent); for (var i = 0; i < 100; i++) { var outfile = Guid.NewGuid() + ".pdf"; outfile = Path.Combine(Path.GetTempPath(), outfile); ConvertWithProcess(chrome, infile, outfile); } } }
public void TreadingStressTest() { using (var chrome = new ChromeProcess()) { chrome.EnsureRunning(); var infile = Guid.NewGuid() + ".xml"; infile = Path.Combine(Path.GetTempPath(), infile); File.WriteAllText(infile, _xmlFileContent); var tasks = new List <Task>(); for (var i = 0; i < 100; i++) { tasks.Add(Task.Run(() => { var outfile = Guid.NewGuid() + ".pdf"; outfile = Path.Combine(Path.GetTempPath(), outfile); ConvertWithProcess(chrome, infile, outfile); })); } Task.WaitAll(tasks.ToArray()); } }