Skip to content

Commit 25916c0

Browse files
committed
polish this example
1 parent 6ef2d99 commit 25916c0

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

examples/timer/thread1.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ function thread1() %#codegen
22

33
stllog('hello from thread1');
44

5-
for i=1:20
5+
for i=1:100
66
stl.semwait(0)
7-
stl.log('wakeup');
7+
ii = int32(i)
8+
stl.log('wakeup %d', ii);
89
end
910
end
1011

examples/timer/user.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
stllog('thread id %d', t1)
1414

1515
timer = stl.timer('timer1', 2.0, s1);
16+
1617
join(t1); % wait for thread 1 to finish
1718

18-
1919
% done, exiting will tear down all the threads
2020

2121
end

0 commit comments

Comments
 (0)