#include <time.h> void delay(int ms) { clock_t start = clock(); while(clock() - start < ms); } delay(500); 延时500毫秒