#How to decrease a value every 3 seconds?

1 messages · Page 1 of 1 (latest)

wooden gazelleBOT
#

This post has been reserved for your question.

Hey @knotty rune! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

scarlet hill
#

idk if this is the best way to do it but you can do it like this

Thread thread = new Thread() {
   @Override
   public void run() {
      while(true) {
         try {
            sleep(3000);
            System.out.println("This message gets printed to the console every three seconds!");
         } catch (InterruptedException e) {
            e.printStackTrace();
         }
      }
   }
};

thread.start();```
#

@knotty rune

knotty rune
#

Okay. Thanks.

wooden gazelleBOT
# knotty rune Okay. Thanks.

If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.