Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

How to Equalise time seconds
Started by akhtarx5 May 11 2019 02:38 PM

- - - - -
2 replies to this topic
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

akhtarx5

[GLOBAL: userInfoPane.html]
akhtarx5
  • Enthusiast

  • 70 posts
  • Corona SDK

Hi All

 

I have a countdown time which has 5 different countdown seconds

 

i.e

 

46801

46802

46801

46802

46801

 

the seconds count down

 

how can equalise the 5 different times so they all read the lowest seconds i.e  46801 in this case.

all seconds are within 1 second of each other but as the code loops there will be some sort of delay

causing some of the units to lag behind a seconds or so

 

it seems to be better on the eyes when the times are the same and move the same

 

so in the above exampe i am lookin to display

 

46801

46801

46801

46801

46801

 

rather than a mix

thankyou



[TOPIC: post.html]
#2

anaqim

[GLOBAL: userInfoPane.html]
anaqim
  • Contributor

  • 770 posts
  • Corona SDK

Hi, you could something like this.

 

local displayTime=math.min(time1,time2,time3,time4,time5)



[TOPIC: post.html]
#3

agramonte

[GLOBAL: userInfoPane.html]
agramonte
  • Corona Geek

  • 1,218 posts
  • Corona SDK

Why not use one timer if you want them all to be the same? And display that timer 5 times.




[topic_controls]
[/topic_controls]