wip
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
import option::{some, none};
|
||||
import option = option::t;
|
||||
export option, some, none;
|
||||
export repeat;
|
||||
|
||||
// Export the log levels as global constants. Higher levels mean
|
||||
// more-verbosity. Error is the bottom level, default logging level is
|
||||
@@ -15,3 +16,16 @@ const error : int = 0;
|
||||
const warn : int = 1;
|
||||
const info : int = 2;
|
||||
const debug : int = 3;
|
||||
|
||||
/*
|
||||
Function: repeat
|
||||
|
||||
Execute a function for a set number of times
|
||||
*/
|
||||
fn repeat(times: uint, f: block()) {
|
||||
let i = 0u;
|
||||
while i < times {
|
||||
f();
|
||||
i += 1u;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user