Coder Social home page Coder Social logo

Comments (4)

RobThree avatar RobThree commented on July 19, 2024

27484e7 is a better implementation for the DefaultTimeSource. This implementation should guarantee a forward-only monotonic increasing clock, except between reboots where the time may be adjusted backwards without IdGen noticing.

The most important issue of #1 is thus solved; however: I would still like to move away from the "milliseconds" and go for a more abstract 'ticks' kind of concept. That way we can have the user provide an ITimeSource that, for instance, ticks every second or day or... whatever the desired resolution is. This way the user is better able to control the timestamp part of the generated ID's.

So "part two" of this issue still remains: move away from DateTime and move to "ticks".

from idgen.

RobThree avatar RobThree commented on July 19, 2024

Changed my mind (10bf70f) and went for QueryPerformance counter. Even though it can "leap" a bit sometimes, it is still a strictly increasing (or non-decreasing) timer. You can still run in trouble when you restart your application or system while adjusting the clock in-between but other than that you should be fine. Still: part two remains; I want to move away from "milliseconds" and to "ticks" (be it a second or a millisecond or a century; a tick is what the user defines it to be).

from idgen.

RobThree avatar RobThree commented on July 19, 2024

I just committed 7fc9120; this is a breaking change but does move away from the fixed millisecond resolution. Some more testing & verification will need to be done before calling this RC final.

Feedback is very welcome!

from idgen.

RobThree avatar RobThree commented on July 19, 2024

Released 2.0 today

from idgen.

Related Issues (20)

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.