本文整理汇总了C++中PluginInfo::get_thread_count方法的典型用法代码示例。如果您正苦于以下问题:C++ PluginInfo::get_thread_count方法的具体用法?C++ PluginInfo::get_thread_count怎么用?C++ PluginInfo::get_thread_count使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PluginInfo
的用法示例。
在下文中一共展示了PluginInfo::get_thread_count方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wait_all_plugin_to_finish
void wait_all_plugin_to_finish(GPtrArray *plugin_array)
{
if (!plugin_array)
return;
struct timeval start_time;
gettimeofday(&start_time, NULL);
for (int i=0; i < plugin_array->len; i++)
{
PluginInfo *plugin = g_ptr_array_index(plugin_array,i);
if (!plugin)
continue;
while (plugin->get_thread_count() > 0)
{
g_usleep(500*1000);
print_statistic(&start_time);
}
}
/* print final statistic: */
print_statistic(&start_time);
unsigned long count = sent_messages_num;
struct timeval now;
gettimeofday(&now, NULL);
double total_runtime_sec = time_val_diff_in_sec(&now, &start_time);
if (total_runtime_sec > 0 && count > 0)
fprintf(stderr,
"average rate = %.2lf msg/sec, count=%ld, time=%g, (average) msg size=%"G_GINT64_FORMAT", bandwidth=%.2f kB/sec\n",
(double)count/total_runtime_sec,
count,
total_runtime_sec,
(gint64)raw_message_length/count,
(double)raw_message_length/(total_runtime_sec*1024) );
else
fprintf(stderr, "Total runtime = %g, count = %ld\n",total_runtime_sec, count);
}