The thread that encounters this pragma constructs a team of threads to execute the structured-block. The thread that encounters the pragma becomes the master thread with a thread number of zero. The remaining threads are assigned unique numbers between 1 and (N-1), where N is the number of threads in the team. The number of threads in the team is constant for the duration of the structured-block.
The following example demonstrates how to use this pragma to create a team of N threads, each with its own private copy of the variables start, end, and tag. Each variable tag is initialized from the encountering thread's value of tag. Each thread executes the code to compute their own starting time and total time and logs those times in the shared array timing: