Reputation: 2913
For an assignment we have to show difference in time of execution between single thread and multithread. I was wondering if this counts as single thread, or if I actually have to call a new Thread object etc...
Upvotes: 1
Views: 87
Reputation: 14360
Yes, you always have the main thread. Creating a new thread formally makes it multi-threaded (but for practical uses if the main thread only waits for the second thread to complete it can often be considered as single threaded).
Upvotes: 2
Reputation: 32
public class x {
public static void main(String [] mainIsAThread) {
system.out.println("hello world");
}
}
//that is one thread
Upvotes: 1