解决方案 »

  1.   

            在cocos3.0 中,去掉了CCTimer这个类。 
              
            我们需要把之前的代码修改为 
            定义时间的变量是 
            struct timeval start  
              
            1.获取时间的方式是: 
            gettimeofday(&start, NULL);   
              
            2.计算两个时间的差的方法需要自己写 
            double timersubCocos2d(struct timeval *start, struct timeval *end) { if (! start || ! end) { return 0; } return ((end->tv_sec*1000.0+end->tv_usec/1000.0) - (start->tv_sec*1000.0+start->tv_usec/1000.0)); }