#Help, trying to learn how to use threads

3 messages · Page 1 of 1 (latest)

rigid pivot
#

Hello, im trying to learn how to use threads, this is my code:

testThread = new Thread(new Runnable() {
                        int timer = 0;

                        @Override
                        public void run() {
                            timer++;
                            if (timer == 200) {
                                timer = 0;
                                System.out.println("Example message");
                            }

                        }
                    });
testThread.start();
``` but it doesnt work, please help
runic jacinthBOT
#

This post has been reserved for your question.

Hey @rigid pivot! 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.