Unity Job System Explained
 on a handle within a single function like this will stall the main thread.
This means issues like buttons freezing when pressed will occur.
(Complete() is more accurately described as a "wait" — similar to await.)
 at the end to ensure the job has definitively finished.)

{
i = 0;
StartCoroutine(CoTest());
}
private void Update()
{
print("Frame: " + i++);
}
IEnumerator CoTest()
{
yield return null;
TestJob testJob;
handle = testJob.Schedule();
print(handle.IsCompleted);
// To test, leave yield return null; just remove the While section.
while(!handle.IsCompleted)
{
yield return null;
}
handle.Complete();
print(handle.IsCompleted + "----------------------------------------------------------------------------");
}
struct TestJob : IJob
{
public void Execute()
{
for (int i = 0; i < 10000; i++)
{
print(i);
}
}
}
}