📄 periodicunrel.java
字号:
package testrt;import util.*;import joprt.*;import com.jopdesign.sys.*;// use differnet (unrelated) period to find WC Jitterpublic class PeriodicUnrel { static class Busy extends RtThread { private int c; Busy(int per, int ch) { super(5, per); c = ch; } public void run() { for (;;) {// Dbg.wr(c); waitForNextPeriod(); } } } public static void main(String[] args) { Dbg.initSer(); // use serial line for debug output RtThread rt = new RtThread(10, 100000) { public void run() { waitForNextPeriod(); int ts_old = Native.rd(Const.IO_US_CNT); for (;;) { waitForNextPeriod(); int ts = Native.rd(Const.IO_US_CNT); Result.printPeriod(ts_old, ts); ts_old = ts; } } }; int i; for (i=0; i<10; ++i) { new Busy(2345+456*i, i+'a'); } RtThread.startMission(); // sleep for (;;) { Dbg.wr('M'); Timer.wd(); for (;;) ; // try { Thread.sleep(1200); } catch (Exception e) {} } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -