# Help Any one give me info where i find one digital timer for Android mode

**URL:** https://discourse.processing.org/t/help-any-one-give-me-info-where-i-find-one-digital-timer-for-android-mode/29293
**Category:** Processing for Android
**Tags:** homework
**Created:** [April 12, 2021, 7:11am UTC](https://discourse.processing.org/t/help-any-one-give-me-info-where-i-find-one-digital-timer-for-android-mode/29293 "2021-04-12T07:11:27Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![r0x15](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@r0x15](https://discourse.processing.org/u/r0x15)
#### Post date: [April 12, 2021, 7:11am UTC](https://discourse.processing.org/t/help-any-one-give-me-info-where-i-find-one-digital-timer-for-android-mode/29293/1 "2021-04-12T07:11:27Z")

</div>

Read topic  
Any info  
Tankyou

---

<div class="post-metadata">

### Author: ![micuat](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micuat/32/19407_2.png) [@micuat](https://discourse.processing.org/u/micuat)
#### Post date: [April 12, 2021, 7:30am UTC](https://discourse.processing.org/t/help-any-one-give-me-info-where-i-find-one-digital-timer-for-android-mode/29293/2 "2021-04-12T07:30:30Z")

</div>

read [Guidelines—Asking Questions](https://discourse.processing.org/t/guidelines-asking-questions/2147)  
thank you

---

<div class="post-metadata">

### Author: ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)
#### Post date: [April 12, 2021, 7:52am UTC](https://discourse.processing.org/t/help-any-one-give-me-info-where-i-find-one-digital-timer-for-android-mode/29293/3 "2021-04-12T07:52:06Z")

</div>

hide ellipse int duration = 1000; change the duration you change time you can text the time

```auto

int startMillis;
int duration = 1000;

void draw() {
  background(0);
  if (mousePressed) {
    startMillis = millis();
  }

  if (millis() < startMillis + duration) {
    ellipse(mouseX, mouseY, 10, 10);
  }
}

```

---

<div class="post-metadata">

### Author: ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)
#### Post date: [April 12, 2021, 9:00am UTC](https://discourse.processing.org/t/help-any-one-give-me-info-where-i-find-one-digital-timer-for-android-mode/29293/4 "2021-04-12T09:00:48Z")

</div>

> [@A timer which activates by pressing a button](https://discourse.processing.org/t/a-timer-which-activates-by-pressing-a-button/25818):
>
> I’m trying to make a timer which starts by pressing a button. I’ve tried millis() but it starts counting as soon as I start the program.

:

```auto
// The duration of the timer
int timerDuration = 2000;

// The time at which we start the timer
int startTime = 0;

// Whether or not the timer was started
boolean timerStarted = false;

void setup() {
  size(200, 200);
}

void draw() {
  background(255);
  
  if (timerStarted) {
    // We subtract the current time and the time when we started the timer
    int currentDuration = millis() - startTime;
    
    fill(0);
    textAlign(CENTER, CENTER);
    text(currentDuration, width / 2, height / 2);
    
    // If the event is over
    if (currentDuration > timerDuration) {
      timerStarted = false;
    }
  }
}

// When the mouse is pressed, take the current time and store it
void mousePressed() {
  startTime = millis();
  timerStarted = true;
}

```

---

<div class="post-metadata">

### Author: ![r0x15](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@r0x15](https://discourse.processing.org/u/r0x15)
#### Post date: [April 12, 2021, 1:02pm UTC](https://discourse.processing.org/t/help-any-one-give-me-info-where-i-find-one-digital-timer-for-android-mode/29293/5 "2021-04-12T13:02:35Z")

</div>

I was wrong to post the code but could it be used for the timer?

```auto
long time = 25*60000;
void setup() {
  size(300,300); 
}

boolean running = false;
long start = millis();
float a = 0;

void draw() {
  if ( running ) {
    a = (millis() - start)* TWO_PI/time;
    if ( a > TWO_PI ) running = false;
  }
  noStroke();
  background( 0 );
  if ( running ) {
    fill(128,255,0);
  } else {
    fill(255,0,0);
  }
  arc( 150,150,200,200, -PI/2, -PI/2 + a);
  fill(0);
  arc( 150,150,150,150, -PI/2, -PI/2 + a+.1 );
  fill(255);
  long rem = time - ( millis() - start );
  if ( running ) {
    int m = floor(rem/60000.0);
    int s = int((rem/60000.0 - m) * 60);
    text(nf(m,2)+":"+nf(s,2),135,150); 
  } else {
    int m = floor(time/60000.0);
    int s = int((time/60000.0 - m) * 60);
    text(nf(m,2)+":"+nf(s,2),135,150);
  }  
}

void mousePressed() {
  if ( !running ) {
    start = millis();
    running = true;
  }
}

```

---

<div class="post-metadata">

### Author: ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)
#### Post date: [April 12, 2021, 1:04pm UTC](https://discourse.processing.org/t/help-any-one-give-me-info-where-i-find-one-digital-timer-for-android-mode/29293/6 "2021-04-12T13:04:44Z")

</div>

@r0x15,

You posted your code (unformatted) with no comments or questions.

You may want to read these:

- [FAQ - Processing Foundation](https://discourse.processing.org/faq) Contains _Format Your Code_ and _Homework Policy_
- [Guidelines—Asking Questions](https://discourse.processing.org/t/guidelines-asking-questions/2147)
- [Guidelines—Answering Questions](https://discourse.processing.org/t/guidelines-answering-questions/2145/1)

`:)`

---

<div class="post-metadata">

### Author: ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)
#### Post date: [April 12, 2021, 7:54pm UTC](https://discourse.processing.org/t/help-any-one-give-me-info-where-i-find-one-digital-timer-for-android-mode/29293/7 "2021-04-12T19:54:30Z")

</div>

> [@r0x15](#):
>
> could it be used for the timer?

It is your project and code so you have to decide.

I would replace the inner arc() with a circle() and fill() that.

`:)`

---

<div class="post-metadata">

### Author: ![r0x15](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@r0x15](https://discourse.processing.org/u/r0x15)
#### Post date: [April 13, 2021, 5:38am UTC](https://discourse.processing.org/t/help-any-one-give-me-info-where-i-find-one-digital-timer-for-android-mode/29293/8 "2021-04-13T05:38:50Z")

</div>

I need timer this 00:00:00 where possible set allarm and when reached set pin ON

---

<div class="post-metadata">

### Author: ![jafal](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jafal/32/19112_2.png) [@jafal](https://discourse.processing.org/u/jafal)
#### Post date: [April 20, 2021, 8:26pm UTC](https://discourse.processing.org/t/help-any-one-give-me-info-where-i-find-one-digital-timer-for-android-mode/29293/9 "2021-04-20T20:26:53Z")

</div>

read this

> [@Countdown d, h, min, sec and ms?](https://discourse.processing.org/t/countdown-d-h-min-sec-and-ms/18145/4):
>
> Hello @Teljemo, See my post: [Difference between two times (measuring time)](https://discourse.processing.org/t/difference-between-two-times-measuring-time/15728/4)[https://www.tutorialspoint.com/java/lang/system\_currenttimemillis.htm](https://www.tutorialspoint.com/java/lang/system_currenttimemillis.htm) states: java.lang.System.currentTimeMillis() returns the difference, measured in milliseconds, between the current time and midnight, January 1, 1970 UTC(coordinated universal time). I used June 1, 2020 as my target date: [Days between Dates](https://www.timeanddate.com/date/durationresult.html?m1=1&d1=1&y1=1970&m2=6&d2=1&y2=2020) Some code I wrote quickly using System.currentTimeMillis(): // Time Elapsed using System.currentTimeMil…
