Skip to content

Commit

Permalink
update README with timer and version
Browse files Browse the repository at this point in the history
  • Loading branch information
briangu committed Jul 24, 2023
1 parent 2646ca7 commit 26be49f
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ KlongPy is a powerful language for high performance data analysis and distribute
* __Array Programming__: KlongPy supports array programming, which makes it a great tool for mathematical and scientific computing. You can manipulate entire arrays of data at once, enabling efficient data analysis and manipulation.
* __Compatibility__: KlongPy is designed to be compatible with Python, allowing you to leverage existing Python libraries and frameworks in conjunction with KlongPy. This seamless integration enhances KlongPy's usability and adaptability.
* __Web server__: Includes a web server, making it easy to build sites backed by KlongPy capabilities.
* __Timers__: Includes periodic timer facility to periodically perform tasks.

At its heart, KlongPy is about infusing Python's flexibility with the compact Klong array language, allowing you to tap into the performance of NumPy while writing code that's concise and powerful.

Expand Down Expand Up @@ -488,6 +489,43 @@ $ curl "http://localhost:8888"
[100]
```
# Timer
KlongPy includes periodic timer capabilities:
```
cb::{.p("hello")}
th::.timer("greeting";1;cb)
```
To stop the timer, it can be closed via:
```
.timerc(th)
```
The following example will create a timer which counts to 5 and then
terminates the timer by return 0 from the callback.
```
counter::0
u::{counter::counter+1;.p(counter);1}
c::{.p("stopping timer");0}
cb::{:[counter<5;u();c()]}
th::.timer("count";1;cb)
```
which displays:
```
1
2
3
4
5
stopping timer
``
# Performance
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
setup(
name='klongpy',
packages=['klongpy', 'klongpy.web'],
version='0.4.0',
version='0.4.1',
description='Python implementation of Klong language.',
author='Brian Guarraci',
license='MIT',
Expand Down

0 comments on commit 26be49f

Please sign in to comment.