The sample demonstrates the use of the DelayActivity activity. The DelayActivity activity causes a workflow (or a branch of a workflow) to pause execution for a specified duration. A DelayActivity activity is frequently used to implement a time-out in one branch of a ListenActivity activity, among other uses.
In the sample, a DelayActivity activity is added to a sequential workflow between two CodeActivity activities. The CodeActivity activities print the current time before and after the delay to the console. The DelayActivity is configured for two seconds, and the actual delay time is printed to the console.
The console output appears as follows:
To build the sample
Download the sample by clicking Download Sample in this topic.
This extracts the sample project to your local hard disk.
Click Start, point to Programs, point to Microsoft Windows SDK, and then click CMD Shell.
Go to the source directory of the sample.
At the command prompt, type MSBUILD <Solution file name>.
To run the sample
- In the SDK Command Prompt window, run the .exe file in the Delay\bin\debug folder (or the Delay\bin folder for the Visual Basic version of the sample), which is located below the main folder for the sample.
© 2007 Microsoft Corporation. All rights reserved.