|
|
@ -1,6 +1,6 @@ |
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* |
|
|
|
* |
|
|
|
* Copyright 2015, Google Inc. |
|
|
|
* Copyright 2015-2016, Google Inc. |
|
|
|
* All rights reserved. |
|
|
|
* All rights reserved. |
|
|
|
* |
|
|
|
* |
|
|
|
* Redistribution and use in source and binary forms, with or without |
|
|
|
* Redistribution and use in source and binary forms, with or without |
|
|
@ -201,13 +201,16 @@ int main(int argc, char **argv) { |
|
|
|
|
|
|
|
|
|
|
|
sc.init(); |
|
|
|
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(); |
|
|
|
sc.do_one_step(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
gpr_log(GPR_INFO, "start profiling"); |
|
|
|
gpr_log(GPR_INFO, "start profiling"); |
|
|
|
grpc_profiler_start("client.prof"); |
|
|
|
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(); |
|
|
|
start = now(); |
|
|
|
sc.do_one_step(); |
|
|
|
sc.do_one_step(); |
|
|
|
stop = now(); |
|
|
|
stop = now(); |
|
|
|