commit 51ef9a987b63cee82a33b0ad62e40748f600dfcf
parent 85b7772651c129fb7c8260e2e1f750f9e0de47ce
Author: Jackson G. Kaindume <seestem@protonmail.com>
Date: Sun, 18 Jul 2021 10:06:05 +0200
docs and comments
Diffstat:
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/README b/README
@@ -9,16 +9,16 @@
use funscheduler::{FunScheduler, Timing};
fn main() {
- // Execute job every second
- FunScheduler::interval(job, Timing::Seconds(1));
+ // Execute job every five seconds
+ FunScheduler::interval(job, Timing::Seconds(5));
}
-
+
fn job() {
println!("Hello, world");
}
----------------------------------------------------------------------
- Timings allow simple congiguration of the function execution
+ Timing configurations
----------------------------------------------------------------------
Timing::Seconds(1)
@@ -27,7 +27,7 @@
Timing::Days(1)
----------------------------------------------------------------------
- Job runners, different methods/ways to execute the function
+ Job runners, different methods to execute the function
----------------------------------------------------------------------
// Evaluates a function at specified intervals, starting now
diff --git a/src/lib.rs b/src/lib.rs
@@ -10,12 +10,12 @@ pub enum Timing {
Days(u64),
}
-/// Different methods/ways of running functions
+/// Different methods for running functions according to time.
pub struct FunScheduler;
impl FunScheduler {
/// Execute a function in specified time interval,
- /// the function will be executed imidiately and then start
+ /// the function will be executed imidiately.
pub fn interval(job: fn(), timing: Timing) {
let time = calc_time(timing);
@@ -28,7 +28,7 @@ impl FunScheduler {
}
}
- /// Like intervals but does not execute immediately.
+ /// Like interval but does not execute immediately.
pub fn rinterval(job: fn(), timing: Timing) {
let time = calc_time(timing);