2011-03-30 156 views
0
定時器

我的代碼:顯示毫秒

myTextBox.text = count1.currentCount.toString(); 

我怎麼會顯示以毫秒爲單位的當前計數?

回答

2

如果你想通過1000 currentCount轉換成毫秒,只是乘:

var currentMilliseconds = count1.currentCount * 1000; 

簡而言之,1次是1000毫秒。因此,轉換:

milliseconds = seconds * 1000; 
seconds = milliseconds * 0.001; 

你的情況:

myTextBox.text = String(count1.currentCount * 1000); 
+0

只是解析對象計時器在文本框中? – DIM3NSION 2011-03-30 22:58:11

+0

抱歉,您希望將count1.currentCount轉換爲毫秒? – Feltope 2011-03-30 23:00:08

+0

是的,如果多數民衆贊成 – DIM3NSION 2011-03-30 23:01:35