skip to Main Content

Ubuntu – How to send multiple requests to a server at few milliseconds of interval in C#

I have a code that looks like this: public static async Task<Request> SendRequest(Client client, DateTime startTime, int offset) { TimeSpan timeToWait = startTime - DateTime.UtcNow + TimeSpan.FromMilliseconds(offset); await Task.Delay(timeToWait); Console.Write(offset); Request request = client.sendRequest(); } async static public Task<Request> SendMultiple(Client…

VIEW QUESTION

Json – Fetch not syncing with for loop

I am trying to fetch json data from the unsplash api inside of a for loop but it will not sync with the loop. async function myfunction(){ for (x=0;x<=c.length-1; x++){ await fetch('https://api.unsplash.com/search/photos? client_id=123;query=' + c[x].value).then(function(response){ response.json().then(function(data) { //out of sync…

VIEW QUESTION
Back To Top
Search