the reason is your thread has been executed, and you didn't specify any code block inside. If you want to make the thread sleep, you should write code like:
Thread thread = new Thread(new Runnable(){
@Override
public void run() {
for (;;) {
Date date = new Date();
DateFormat nyDf = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL);
DateFormat.getDateInstance();
TimeZone tz = TimeZone.getTimeZone("America/New_York");
String finaldate = (nyDf.format(date).replace("EDT", "EST"));
System.out.println(DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL ).format(date));
id = new DBCount().readQuery(con);
prcs = new DBCount().workerprocess(con);
logger.info(finaldate + ": count - " + id);
labelchange(id, prcs,finaldate, con);
t.sleep(5000);
}
}
});
thread.start();