用此函数来获取从SDL库初始化来所经历过的时间,单位为微秒。返回是unsigned 32-bit类型。
unsigned int lastTime = 0, currentTime; while (!quit) { // do stuff // ... // Print a report once per second currentTime = SDL_GetTicks(); if (currentTime > lastTime + 1000) { printf("Report: %d\n", variable); lastTime = currentTime; } }
http://blog.csdn.net/finewind/article/details/40391423
蔡军生