代码
private float nowTime;
public Text timeText;
void Update()
{
nowTime += Time.deltaTime;
int hour = (int)nowTime / 3600;
int minute = (int)(nowTime - hour * 3600) / 60;
int second = (int)(nowTime - hour * 3600 - minute * 60);
int millSecond = (int)((nowTime - (int)nowTime) * 1000);
timeText.text = string.Format("{0:D2}:{1:D2}:{2:D2}:{3:D3}", hour, minute, second, millSecond);
}