Advertisement
Guest User

Untitled

a guest
Apr 21st, 2020
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. sum : Int64 = 0
  2. part1 : Int64 = 0
  3. part2 : Int64 = 0
  4. done1 = false
  5. done2 = false
  6.  
  7. spawn do
  8. (0..500000000).each do |num|
  9. part1 += num
  10. end
  11. done1 = true
  12. end
  13.  
  14. spawn do
  15. (500000001..1000000000).each do |num|
  16. part2 += num
  17. end
  18. done2 = true
  19. end
  20.  
  21. while !done1 && !done2
  22. sleep 1.second
  23. end
  24.  
  25. sum = part1 + part2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement