threads_01.gm 287 B

123456789101112131415
  1. global thread_1 = function( a_count )
  2. {
  3. print( "[1] Starting..." );
  4. for (i = 0; i < a_count; i = i + 1)
  5. {
  6. print( "[1] iteration: " + i );
  7. };
  8. print( "[1] Finishing..." );
  9. };
  10. print( "[0] Ready to execute..." );
  11. thread( thread_1, 100 );
  12. sleep(1);
  13. print( "[0] Thread created..." );