diff --git a/test/core/fling/client.c b/test/core/fling/client.c
index 99b30d6c4a902c87a52d03b5202d6f70cad15fae..d5f78b277ae55be2e154c0b48d783e28971ebd3a 100644
--- a/test/core/fling/client.c
+++ b/test/core/fling/client.c
@@ -201,13 +201,16 @@ int main(int argc, char **argv) {
 
   sc.init();
 
-  for (i = 0; i < 1000; i++) {
+  gpr_timespec end_warmup = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(3);
+  gpr_timespec end_profiling = GRPC_TIMEOUT_SECONDS_TO_DEADLINE(30);
+  
+  while (gpr_time_cmp(gpr_now(end_warmup.clock_type), end_warmup) < 0) {
     sc.do_one_step();
   }
 
   gpr_log(GPR_INFO, "start profiling");
   grpc_profiler_start("client.prof");
-  for (i = 0; i < 100000; i++) {
+  while (gpr_time_cmp(gpr_now(end_profiling.clock_type), end_profiling) < 0) {
     start = now();
     sc.do_one_step();
     stop = now();