add prof2 profiler
[goodguy/cinelerra.git] / cinelerra-5.1 / prof2 / tst.c
diff --git a/cinelerra-5.1/prof2/tst.c b/cinelerra-5.1/prof2/tst.c
new file mode 100644 (file)
index 0000000..a641ec0
--- /dev/null
@@ -0,0 +1,31 @@
+#include <stdio.h>
+
+void tst0()
+{
+   printf(".");
+}
+
+void tst1()
+{
+   printf("\r");
+}
+
+void tst2(int n)
+{
+   volatile int i = n;
+   while( --i >= 0 );
+   if( (n&1) != 0 ) tst1(); else tst0();
+}
+
+int main(int ac, char **av,char **ev)
+{
+   int i;
+   //profileStart();
+   setbuf(stdout,NULL);
+   printf("ok. %s\n",ev[0]);
+   for( i=30000; --i>=0; ) tst2(i);
+   printf("\n");
+   printf("done\n");
+   return 0;
+}
+