1
0
dust/examples/async.ds

20 lines
343 B
Plaintext
Raw Normal View History

2023-12-30 02:15:03 +00:00
create_random_numbers = (count <int>) <none> {
numbers = []
2023-11-04 03:42:10 +00:00
2023-12-30 02:15:03 +00:00
while length(numbers) < count {
2024-01-03 20:25:53 +00:00
numbers += random:integer()
2023-11-04 03:42:10 +00:00
}
2023-12-30 02:15:03 +00:00
output("Made " + length(numbers) + " numbers.")
2023-11-04 03:42:10 +00:00
}
2023-12-30 02:15:03 +00:00
output("This will print first.")
2023-11-30 14:48:56 +00:00
2023-11-04 03:42:10 +00:00
async {
2023-12-30 02:15:03 +00:00
create_random_numbers(1000)
create_random_numbers(100)
create_random_numbers(10)
2023-11-04 03:42:10 +00:00
}
2023-12-30 02:15:03 +00:00
output("This will print last.")