Questions tagged [countdown]

This tag refers to the process of counting down. In other words, the act of taking an initial value and then consistently subtracting a smaller value from it until the original value reaches a specified amount (usually 0).

Use this tag for questions that deal with counting down or countdown timers (a device that performs the countdown).

2079 questions
266
votes
3 answers

How to write a countdown timer in JavaScript?

Just wanted to ask how to create the simplest possible countdown timer. There'll be a sentence on the site saying: "Registration closes in 05:00 minutes!" So, what I want to do is to create a simple js countdown timer that goes from "05:00" to…
Bartek
  • 2,711
  • 3
  • 10
  • 5
194
votes
13 answers

How is CountDownLatch used in Java Multithreading?

Can someone help me to understand what Java CountDownLatch is and when to use it? I don't have a very clear idea of how this program works. As I understand all three threads start at once and each Thread will call CountDownLatch after 3000ms. So…
amal
  • 3,160
  • 8
  • 25
  • 40
193
votes
14 answers

How to make a countdown timer in Android?

I have two EditTexts in XML. In one EditText, the user can put a number as minutes and in another EditText, a number as seconds. After clicking the finish button, the seconds EditText should start to countdown and update its text every second.…
Sabbir Ahmed
  • 1,987
  • 2
  • 13
  • 13
66
votes
11 answers

Flutter Countdown Timer

How can I do to put the value passed in the construction, to make a timer that rounds to the first decimal and shows at the child text of my RaisedButton? I've tried but without luck. I manage to make work the callback function with a simple Timer…
Floris Marpepa
  • 1,001
  • 2
  • 8
  • 17
53
votes
9 answers

Countdown timer using Moment js

I am making a countdown timer for an event page, i used moment js for this. Here is fiddle for this. I am calculating date difference between event date and current date (timestamp), then using "duration" method from moment js. But the time left is…
Arpit Rawat
  • 1,669
  • 2
  • 17
  • 28
52
votes
12 answers

Android: CountDownTimer skips last onTick()!

Code: public class SMH extends Activity { public void onCreate(Bundle b) { super.onCreate(b); setContentView(R.layout.main); TextView tv = (TextView) findViewById(R.id.tv); new CountDownTimer(10000,…
49
votes
10 answers

angularjs make a simple countdown

I would like make a countDown with Angular js. this is my code: Html File
{{countDown}}…
user1613464
45
votes
7 answers

Countdown timer in React

I have seen lots of countdown timers in JavaScript and wanted to get one working in React. I have borrowed this function I found online: secondsToTime(secs){ let hours = Math.floor(secs / (60 * 60)); let divisor_for_minutes = secs % (60 *…
The worm
  • 3,578
  • 10
  • 26
  • 44
40
votes
3 answers

Android ProgressBar countdown

I'm making a quiz for Android and I want a limited time to answer every question. So I want to display a ProgressBar under the answers that counts down from, for example, 5 to 0 (seconds). And when it reaches zero I want to do some stuff. I have the…
simtaxman
  • 583
  • 2
  • 9
  • 17
38
votes
4 answers

Countdown Timer Image GIF in Email

I recently received an emailer from Onnit Labs that included a Countdown Module Timer inside the emailer using a gif image. The emailer can be viewed here: https://www.onnit.com/emails/lastchance-historic/ The Image can be seen here: I looked into…
alvaram
  • 405
  • 1
  • 5
  • 7
25
votes
3 answers

how to make a countdown timer in java

I'm a beginner(Student) in programming and was assigned to create a game. The game I'm making is called boggle. In which the player have to find words in a random letter board within a given time. but I'm having trouble with creating the timer. This…
Vamala
  • 291
  • 1
  • 3
  • 3
17
votes
4 answers

How to handle multiple countdown timers in ListView?

I have a listview (with a custom list adapter), I need to display a countdown on every row. For example, if my list contains 4 items, I will have 4 rows. At this point, I need to handle 4 different countdowns (one for each row) because time is…
Rob
  • 708
  • 2
  • 6
  • 16
17
votes
4 answers

How to programmatically set a lock or pin for an app

So right now I am trying to develop an Android App for my young children. I want to set a pin or passwords on selected applications for a particular amount of time to prevent them from opening the app. For example, let's say that my daughter wants…
17
votes
2 answers

How to make a wpf countdown timer?

I want to create wpf countdown timer that display the result as hh:mm:ss into textbox, I would be thankful for anyone help.
user2419978
  • 357
  • 1
  • 3
  • 8
16
votes
4 answers

Can't create handler inside thread that has not called Looper.prepare() in CountDownTimer

I have a service. And there is a method called onServiceUpdate(). This method is similiar with onLocationChanged() in Google Maps API. So i want to start CountDownTimer inside onServiceUpdate() method but showing error like this : Can't create…
Leonard Febrianto
  • 934
  • 2
  • 10
  • 34
1
2 3
99 100