cc_timeval psv;
CCTime::gettimeofdayCocos2d( &
psv, NULL );
// 计算时间种子
unsigned
int tsrans = psv.tv_sec *
1000 + psv.tv_usec /
1000;
// 初始化随机数
srand( tsrans );
转载于:https://www.cnblogs.com/stop/archive/2012/10/12/2721714.html
转载请注明原文地址: https://mac.8miu.com/read-12328.html