-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJSRunner.cs
More file actions
58 lines (47 loc) · 1.87 KB
/
JSRunner.cs
File metadata and controls
58 lines (47 loc) · 1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.IO;
namespace JSRunner
{
class JSRunner
{
static void Main(string[] args)
{
RunJS();
}
public static void RunJS()
{
int profiles = 70000;
int workPerInstance = 10000;
int workChunk = profiles / workPerInstance;
for (int i = 0; i < workChunk; i++)
{
// Prepare the process to run
ProcessStartInfo start = new ProcessStartInfo();
string jsExeFolder = @"..\..\..\jeevansathi\bin\debug";
// Copy JS exe folder
//System.
string jsExeLocation = Path.Combine(jsExeFolder, @"jeevansathi.exe");
// Enter the executable to run, including the complete path
start.FileName = jsExeLocation;// Path.Combine(executingExeDir, jsExeLocation);
// Do you want to show a console window?
start.WindowStyle = ProcessWindowStyle.Normal;// Hidden;
start.CreateNoWindow = false;// true;
int starting = i * workPerInstance;
int ending = starting + workPerInstance;
// Enter in the command line arguments, everything you would enter after the executable name itself
start.Arguments = string.Format("{0} {1} {2}", starting, ending, i);
//Logger.LogIt(Directory.GetCurrentDirectory());
//Thread.Sleep(1000 * 3);
using (Process proc = Process.Start(start))
{
Console.WriteLine(string.Format("Process # {0} started", jsExeLocation));
}
}
// once started, this should return
}
}
}