-4

I have two function and I need to execute it at same time using javacript or any parallel function. How can i do?

Thank so.

6
  • 1
    which implementation of javascript (browser? node?), and why Commented Nov 3, 2017 at 20:50
  • you start by thinking and doing the problem before asking us to do it for you. Commented Nov 3, 2017 at 20:51
  • Look at this question it may help stackoverflow.com/a/7683064/1815624 Commented Nov 3, 2017 at 20:53
  • Look i have two function. And what i need is: Hown I execute it at same time Commented Nov 3, 2017 at 20:53
  • 4
    way to not answer any of the questions! Commented Nov 3, 2017 at 20:55

2 Answers 2

1

I'm not sure you'll find exactly what you're looking for. Does it have to be exactly at the same time? Javascript is single-threaded. But you could do async calls. Would that meet your use case? If not, you could check out Web Workers, but I've never used that before.

Can javascript run multiple functions at once?

Simultaneous code in javascript?

Sign up to request clarification or add additional context in comments.

2 Comments

Thank so much. It's exactly what i was looking for
Awesome :) best of luck!
0

JavaScript is fundamentally not multithreaded. It just processes events in a single pipeline.

There is an npm package that can do multithreading if that's what you really need here:

https://www.npmjs.com/package/threads

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.