source: java2python/core/src/test/java/testcode/DoTimer.java

Last change on this file was 1296, checked in by wouter, 2 weeks ago

#407 added Timer and TimerTask and unit test for these. Small fixes.

File size: 510 bytes
Line 
1package testcode;
2
3import java.util.Timer;
4import java.util.TimerTask;
5
6import org.eclipse.jdt.annotation.NonNull;
7
8class MyTask extends TimerTask {
9
10 @Override
11 public void run() {
12 System.out.println("ok1");
13 }
14
15}
16
17/**
18 * Checks around sub-classes
19 */
20public class DoTimer {
21
22 static public void main(String[] args) throws InterruptedException {
23 final @NonNull Timer timer = new Timer("test timer");
24 final @NonNull TimerTask task = new MyTask();
25 timer.schedule(task, 1000);
26 Thread.sleep(1500);
27 }
28}
Note: See TracBrowser for help on using the repository browser.