void start() => StartCoroutine(MyIEnumerator()); IEnumerator MyIEnumerator() { Debug.Log("Hello world!"); yield return new WaitForSeconds(3); Debug.Log("Goodbye world!"); }