How do I time counter with miliseconds

Get help using Construct 2

Post » Mon Sep 19, 2016 3:50 pm

I create global variable 'timeclock'
and text object for display time in text (set text to timeclock)

EVENTS
-System every 0.1 seconds add to global variable 0.1
(so every 0.1 seconds variable have have 0.1 etc)

great


but problem is when i set
-System every 0.01 seconds add 0.01 to global variable counter never display right time
when game runs 1 second variable display 0.65

how create right timer?
B
24
S
7
Posts: 208
Reputation: 2,032

Post » Mon Sep 19, 2016 4:28 pm

2 ways ....

1/ dt based, Every tick add dt to global variable counter. (System Expression dt = time for one tick)

2/ Wallclocktime based. Set a global variable to System expression wallclocktime on startup. Time is now wallclocktime - global.
B
33
S
18
G
27
Posts: 2,441
Reputation: 20,346

Post » Tue Sep 20, 2016 9:12 am

99Instances2Go wrote:2 ways ....

1/ dt based, Every tick add dt to global variable counter. (System Expression dt = time for one tick)

2/ Wallclocktime based. Set a global variable to System expression wallclocktime on startup. Time is now wallclocktime - global.



Ok thats works better

any ideas how change this displayed time from x.xxxxxx to x.xx ?
B
24
S
7
Posts: 208
Reputation: 2,032

Post » Tue Sep 20, 2016 1:54 pm

bump

anyone?
B
24
S
7
Posts: 208
Reputation: 2,032

Post » Tue Sep 20, 2016 2:32 pm

B
33
S
18
G
27
Posts: 2,441
Reputation: 20,346


Return to How do I....?

Who is online

Users browsing this forum: ramyaswetha, Yahoo [Bot] and 7 guests