我正在使用HttpClient将一个GET请求发送到while循环内的服务器
while (cycle < maxcycle)
{
var searchParameters = new ASearchParameters
{
Page = cycle++,
id = getid
};
var searchResponse = await Client.SearchAsync(searchParameters);
}
Run Code Online (Sandbox Code Playgroud)
并且SearchAsync包含
public async Task<AuctionResponse> SearchAsync()
{
var uriString = "Contains a https url with parameters"
var searchResponseMessage = await HttpClient.GetAsync(uriString);
return await Deserialize<AuctionResponse>(searchResponseMessage);
}
Run Code Online (Sandbox Code Playgroud)
事情发生在每个请求之后,在下一个请求开始之前有一个延迟.你可以在提琴手的时间轴上看到这个,也可以在小提琴手中看到每个请求前都有"Tunnel To"example.com:443

如何为以下循环的每次迭代回显一些内容:
<?
for($i=0;$i<5;$i++) {
// some (slow) logic
echo $i;
}
?>
Run Code Online (Sandbox Code Playgroud)
我希望在运行时看到$i输出的值,但是这不输出任何内容,然后0 1 2 3 4执行脚本.
我想在每次if声明时创建一个新的倒数计时器true,它应该像这样工作:
例如:
List<int> intList = new List<int>();
foreach(a in b)
{
if(a==1)
{
intList.Add(a.somevalue)
//should create a new countdown timer for 1 hour and once the time is finished, it
should remove the added value from the list
}
}
Run Code Online (Sandbox Code Playgroud)
我如何实现这一目标?
谢谢.