You'd better see it from another angle. For example,
for (int i = 0; i < 5000000; i++) {
// do nothing
}
clearly won't take 5 minutes on any modern machine. So the slowness comes from the statements you wrote for each iteration. To further analyze performance, you need to learn tools like performance profilers. Only when you know the actual cause of slowness, you can think of possible solutions (such as running iterations in parallel instead of in sequence).
Keep in mind performance tuning is a huge topic, but basic principles and profilers (even Java has similar tools) apply to all cases.