GithubHelp home page GithubHelp logo

ben-ph / fugit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from korken89/fugit

0.0 0.0 0.0 116 KB

`fugit` provides a comprehensive library of `Duration` and `Instant` for the handling of time in embedded systems, doing all it can at compile time.

License: Apache License 2.0

Rust 100.00%

fugit's Introduction

fugit

fugit provides a comprehensive library of Duration and Instant for the handling of time in embedded systems, doing all it can at compile time.

This library is a heavily inspired of std::chrono's Duration from C++ which does all it can at compile time.

Aims

  • no_std library with goals of user-friendliness and performance first
    • All methods are const fn that can be (i.e. non-trait methods)
    • Traits are only used for constraits. Implementations are monomophised throughout, for maximum const-ification
    • Operations are supported between different bases and backing storages instead of implementing custom traits
    • All constants needed for comparing or changing timebase are guaranteed compile time generated
  • Support for both u32 and u64 backing storage with efficient instruction lowering on MCUs
    • On Cortex-M3 and up: no soft-impls pulled in for both u32 and u64 except when changing base on u64
    • Comparisons on u32 and u64 do not use division, only changing base with all constants calculated at compile time
  • Selection of base happens at compile time, within the type-system.
    • A common problem is that run time changing of base robs us of a lot of optimization opportunities, but since there are no traits and short-hands select the correct base at compile time.
  • Use of type-system for compile-time specifications
    • const generics are limited in what they can do at compile time, make expressing/constraining more complex behaviors difficult/impossible.

fugit's People

Contributors

korken89 avatar ben-ph avatar bors[bot] avatar dependabot[bot] avatar burrbull avatar adamgreig avatar tdholmes avatar andresv avatar haata avatar jannic avatar qiuchengxuan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.