如何显示游戏时间?


void GameLayer::step(ccTime dt)
{
time += dt;
char time_str;
sprintf(time_str, "Time: %d", (int)time);
CCLabelBMFont *label1 = (CCLabelBMFont *)this->getChildByTag(3);
label1->setString(time_str);
}
 // 设定时间回调函数,修改游戏用时显示
  this->schedule(schedule_selector(GameLayer::step), 1.0f);


// 使用位图字体显示游戏时间
CCLabelBMFont *lbScore = CCLabelBMFont::labelWithString("Time: 0", "font09.fnt");
CC_BREAK_IF(! lbScore);
lbScore->setAnchorPoint(ccp(1, 1));
lbScore->setScale(0.6f);
this->addChild(lbScore, 1, 3);
lbScore->setPosition(ccp(310, 450));

上面的代码是在
http://www.cnblogs.com/cocos2d-x/archive/2012/03/01/2376143.html#commentform
博客园看到的一段demo,请教如何在最新的
cocos2d-2.1beta3-x-2.1.0上实现?

备注:CCTime已经被取消了,用float代替