public async Task InvokeAsync(HttpContext context) { using (var time = TimeLogger.Start()) { context.Response.OnStarting(state => { var httpContext = (HttpContext)state; httpContext.Response.Headers.Add("Time", time.FormatedTime); return(Task.CompletedTask); }, context); await _next(context); } }
public override void UpdateComponent() { float[,] heightmap = base.GetTerrainHeight(); int resolution = base.meshGenerator.resolution; if (useGPU) { diamondSquare = new DiamondSquareGPU(resolution, shader); } else { diamondSquare = new DiamondSquare(resolution); } TimeLogger.Start(diamondSquare.GetType().Name, diamondSquare.Resolution); diamondSquare.Apply(heightmap); TimeLogger.RecordSingleTimeInMilliseconds(); base.UpdateTerrainHeight(heightmap); }