Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Informaticore/toit-ringbuffer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

13 Commits

Repository files navigation

ringbuffer

A RingBuffer implementation as a data structure that stores a fixed number of elements and overwrites the oldest elements once the maximum size is reached.

Install

jag pkg install ringbuffer

Usage:

import ringbuffer show *
main: 
 buffer := RingBuffer 32 //initialize the RingBuffer with a size of 32
 buffer.append 1.0 //append a value
 buffer.append 2.0
 buffer.append 3.0 
 print buffer.average //prints the average value of all added values in the ringbuffer in this case 2.0

About

A RingBuffer implementation as a data structure that stores a fixed number of elements and overwrites the oldest elements once the maximum size is reached.

Topics

Resources

License

Stars

Watchers

Forks

Packages

Contributors

Languages

AltStyle によって変換されたページ (->オリジナル) /