- for (i = 0; i < 100; i++) {
- double t = 1.0 - (i / 100.0);
- acre_data_add_point_2d (data1, i, -1000 * (1.0 - t*t*t));
- }
-
- for (i = 0; i <= 1000; i++) {
- double t, x, y;
- t = i/10.0 - 50;
- x = t + 50;
- if (t == 0.0)
- y = -200;
- else
- y = -1200 + 1000 * sin(t) / t;
- acre_data_add_point_2d (data2, x, y);
+ bytes = getline (&line, &line_size, file);
+ if (bytes == -1)
+ break;
+
+ s = line;
+
+ if (STRNCMP_LITERAL (s, "frame-time: ") == 0) {
+ unsigned frame;
+ int64_t frame_time_ns;
+
+ s += strlen("frame-time: ");
+
+ scanned = sscanf (s, "%d %" SCNu64,
+ &frame, &frame_time_ns);
+ if (scanned != 2) {
+ fprintf (stderr, "Warning: Failed to parse line: %s\n", line);
+ continue;
+ }
+
+ acre_data_add_point_2d (frame_time, frame,
+ frame_time_ns / 1e6);
+ } else {
+ /* Ignoring all other lines. */
+ }