[Swift-commit] r8416 - SwiftTutorials/ATPESC_2014-08-14/swift-t/examples/02-loop
wozniak at ci.uchicago.edu
wozniak at ci.uchicago.edu
Thu Mar 26 20:17:37 CDT 2015
Author: wozniak
Date: 2015-03-26 20:17:37 -0500 (Thu, 26 Mar 2015)
New Revision: 8416
Modified:
SwiftTutorials/ATPESC_2014-08-14/swift-t/examples/02-loop/loop.swift
Log:
Minor improvement
Modified: SwiftTutorials/ATPESC_2014-08-14/swift-t/examples/02-loop/loop.swift
===================================================================
--- SwiftTutorials/ATPESC_2014-08-14/swift-t/examples/02-loop/loop.swift 2015-03-24 22:18:38 UTC (rev 8415)
+++ SwiftTutorials/ATPESC_2014-08-14/swift-t/examples/02-loop/loop.swift 2015-03-27 01:17:37 UTC (rev 8416)
@@ -8,9 +8,14 @@
@dispatch=WORKER
(int j) compute(int i) "turbine" "0.0"
[
-----
- after [ expr <<i>> * 1000 ]
- puts "compute: <<i>> [ expr [clock seconds] % 1000]"
+----
+ # Do some math
+ set v [ expr <<i>> * ( [clock seconds] % 1000 ) ]
+ # Print a message
+ puts "compute: <<i>> : $v milliseconds"
+ # Wait a few milliseconds
+ after [ expr $v ]
+ # Return the result
set <<j>> [ expr <<i>> * 2 ]
----
];
More information about the Swift-commit
mailing list