Skip to content

Commit c2876c1

Browse files
committed
measuring time for cpu tracer
1 parent bed72b1 commit c2876c1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

include/ftk/filters/particle_tracer.hh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ inline void particle_tracer::update_timestep()
141141
if (!streamlines && this->snapshots.size() < 2)
142142
return; // nothing can be done
143143

144+
typedef std::chrono::high_resolution_clock clock_type;
145+
auto t0 = clock_type::now();
146+
144147
// fprintf(stderr, "#particles=%zu\n", this->particles.size());
145148
this->parallel_for_container(trajectories, [&](feature_curve_set_t::iterator it) {
146149
// for (auto &kv : trajectories) {
@@ -203,6 +206,10 @@ inline void particle_tracer::update_timestep()
203206

204207
// fprintf(stderr, "%f, %f, %f\n", p.x[0], p.x[1], p.t);
205208
}, FTK_THREAD_PTHREAD, get_number_of_threads());
209+
210+
auto t1 = clock_type::now();
211+
212+
fprintf(stderr, "t_trace=%f\n", std::chrono::duration_cast<std::chrono::nanoseconds>(t1 - t0).count() * 1e-9);
206213
}
207214

208215
inline bool particle_tracer::eval_vt(

0 commit comments

Comments
 (0)