Skip to content

Instantly share code, notes, and snippets.

@neuecc
Created May 14, 2015 07:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neuecc/33a4c29a2d9d6e9872e8 to your computer and use it in GitHub Desktop.
Save neuecc/33a4c29a2d9d6e9872e8 to your computer and use it in GitHub Desktop.
IEnumerator ThreeSeconds()
{
var sw = System.Diagnostics.Stopwatch.StartNew();
yield return new WaitForSeconds(3);
Debug.Log(sw.Elapsed.TotalMilliseconds + "ms");
}
// 3秒でかえってくる
Time.timeScale = 1.0f;
Observable.FromCoroutine(ThreeSeconds).Subscribe();
// 6秒でかえってくる
Time.timeScale = 0.5f;
Observable.FromCoroutine(ThreeSeconds).Subscribe();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment