callbackSpread.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //-------------------------------------------------------------------------------------------------------
  2. // Copyright (C) Microsoft. All rights reserved.
  3. // Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
  4. //-------------------------------------------------------------------------------------------------------
  5. //
  6. //In theory this test could be race-y -- in which case suppress the console printing but in general ch should be well behaved
  7. //
  8. telemetryLog("Start Global Code", true);
  9. function foo1()
  10. {
  11. telemetryLog("Start Foo1", true);
  12. WScript.Echo("Hello World - CallBack 1");
  13. telemetryLog("End Foo1", true);
  14. }
  15. function foo2()
  16. {
  17. telemetryLog("Start Foo2", true);
  18. WScript.Echo("Hello World - CallBack 2");
  19. telemetryLog("End Foo2", true);
  20. }
  21. function foo3()
  22. {
  23. telemetryLog("Start Foo3", true);
  24. WScript.Echo("Hello World - CallBack 3");
  25. telemetryLog("End Foo3", true);
  26. }
  27. WScript.SetTimeout(foo1, 200);
  28. WScript.SetTimeout(foo2, 400);
  29. WScript.SetTimeout(foo3, 600);
  30. WScript.Echo("Hello World - Global");
  31. telemetryLog("End Global Code", true);