Code Monkey home page Code Monkey logo

Comments (5)

oleiade avatar oleiade commented on June 6, 2024 2

For clarification and my understanding, what does the target user-experience look like?

My assumption reading this is:

// No need to import the `k6/timers` module

export default function () {
    setTimeout(...)  // timer functions are available in the runtime "natively", like in v8 browser runtimes
    setInterval(...)
    clearTimeout(...)
    clearInterval(...)
 }

If so, I think that makes a lot of sense, and although I'm not completely set on that, it is also something we might want to consider also for "Web APIs" we integrate in the future (webcrypto, streams, fetch (if we do), etc...) to provide a user-experience close to what is available in other runtimes.

🙇🏻

from k6.

mstoykov avatar mstoykov commented on June 6, 2024 1

Yes, that will be a thing that users will be able to do - without needing to import anything

from k6.

olegbespalov avatar olegbespalov commented on June 6, 2024

I feel that having these functions globally accessible is what users will expect. However, I can't say I'm a JavaScript expert, so I am unsure if my feelings are relevant.

from k6.

joanlopez avatar joanlopez commented on June 6, 2024

Similar to @olegbespalov, not a JS expert neither, but I guess that's what experienced JS users would expect, while for the rest it doesn't matter. So 👍🏻

from k6.

amills-vibeirl avatar amills-vibeirl commented on June 6, 2024

there is no event loop in Goja (TMK). So I am not sure who/what would call the global setInterval. Using Goja for this lib seems like a terrible mistake and frankly I am gonna run as far as I can in another direction (no offense but hopefully this helps other people..)

from k6.

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.