-
Windows
#include <windows.h> //需要的头文件
int main(void)
{
Sleep(1000); //单位,毫秒 (在VC中Sleep中的第一个英文字符为大写的"S")
}
-
Linux
#include <unistd.h> //需要的头文件
int main(void)
{
sleep(1); //单位,秒
}
-
Android
try
{
Thread.sleep(10000);
}
catch (Exception e )
{
}
-
C#
using System.Threading;
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Thread.Sleep(100); //单位:毫秒
}
}