diff --git a/README.md b/README.md
index f48b56a..e675148 100644
--- a/README.md
+++ b/README.md
@@ -20,6 +20,10 @@ void main()
// stop running setInterval()
stopInterval(tid);
stopInterval(tid2);
+
+ // OR keep running timers
+ // using import core.thread.osthread: thread_joinAll;
+ // thread_joinAll();
}
```
## Collections
diff --git a/source/nyinaa/package.d b/source/nyinaa/package.d
index a8cc8e7..6d24d4e 100644
--- a/source/nyinaa/package.d
+++ b/source/nyinaa/package.d
@@ -2,14 +2,6 @@
Nyinaa (meaning "all" or "everything" in Twi language) is an all-in-one collection of reusable functions & utilities (timers, validators, sanitizers, ranges, logging, ...)
Its goal is to provide convenience function commonly used when developing applications such a web development, desktop application and the like. Many functions are not implemented yet. If you want something that is not already available, please submit a pull request OR file an issue at https://github.com/aberba/nyinaa/issues
-
-
These are the categories of utilities currently being implemented.
-
- - Sanitizers - for sanitizing data `stripTags()`, ...
- - Validators - for user data (e.g. form data) validation. `isEmail`, `isIp`, ...
- - Timers - Timer function. `setInterval()`, ...
-
-
+/
module nyinaa;
@@ -22,25 +14,24 @@ public import nyinaa.validators;
unittest
{
import nyinaa : setInterval;
- import std.stdio : writeln, readf;
+ import std.stdio : writeln;
import std.datetime : seconds;
- import core.thread.osthread : Thread, thread_joinAll;
+ import core.thread.osthread : Thread;
void main()
{
- // string name = to!string(2);
-
- // "tid" of type Tid can be referenced
+ // "tid" of type Tid can be referenced
// to stop setInterval()
- auto tid = setInterval(1.seconds, () { writeln("tick"); });
- auto tid2 = setInterval(2.seconds, () { writeln("tock"); });
+ auto tid = setInterval(1000, { writeln("tick"); });
+ auto tid2 = setInterval(3000, { writeln("tock"); });
+ Thread.sleep(12.seconds);
// stop running setInterval()
- // stopInterval(tid);
- // stopInterval(tid2);
- thread_joinAll();
+ stopInterval(tid);
+ stopInterval(tid2);
- // use evenNumbers()
- // evenNumbers([1, 2, 3, 4, 5, 6]);
+ // OR keep running timers
+ // using import core.thread.osthread: thread_joinAll;
+ // thread_joinAll();
}
}