Time Counter
in
Programming Questions
•
1 year ago
Basically what I am trying to accomplish is a timer that starts when X happens and then stops and reports the elapsed time when Y happens. I am trying to do something simple before adapting the code to work in my main project. I am using millis because I need to record a very fast time.
I know there are similar topics, but none seem to fit exactly what I am doing. Any help is appreciated. Thank you.
- float m = millis();
- float c = 0;
- void draw() {
- if(keyPressed) {
- if (key == 'b' || key == 'B') {
- m++;
- println( m );
- }
- if (key == 'a' || key == 'A') {
- c = m;
- println( c );
- }
- }
- }
1