User2019981500 posted
I have got some example which use multiple thread for reading long running processes just run it and see.you can convert it to vb.net also
static void Main(string[] args)
{
Console.Write("How many iterations in total? ");//for you it 10000000
int totalIterations = Int32.Parse(Console.ReadLine());
Console.Write("How many threads? ");
int totalThreads = Int32.Parse(Console.ReadLine());
// So how many iterations per thread? (This is just for example, it will get 1 more than required in some cases)
int iterationsPerThread = (int)Math.Ceiling((double)(totalIterations / totalThreads));
ParameterizedThreadStart threadStart = new ParameterizedThreadStart(threadProcess);
for (int i = 0; i < totalThreads; i++)
{
Thread t = new Thread(threadStart);
t.Start(new[] { i, iterationsPerThread });
}
Console.ReadLine();
}
static void threadProcess(object o)
{
int ThreadNum = ((int[])o)[0];
int Iterations = ((int[])o)[1];
for (int i = 0; i < Iterations; i++)
{
for (int t = 0; i < Iterations; i++)
{
Console.WriteLine("Thread " + ThreadNum + ": On iteration " + i);
}
}
}