[Gridflow-cvs] [svn] commit: r3506 - in /trunk: base/flow_objects.c tests/fps-test.pd

gridflow-cvs at artengine.ca gridflow-cvs at artengine.ca
Mon Apr 14 22:16:46 EDT 2008


Author: matju
Date: Mon Apr 14 22:16:46 2008
New Revision: 3506

Log:
added [usertime] and [systemtime]

Modified:
    trunk/base/flow_objects.c
    trunk/tests/fps-test.pd

Modified: trunk/base/flow_objects.c
==============================================================================
--- trunk/base/flow_objects.c (original)
+++ trunk/base/flow_objects.c Mon Apr 14 22:16:46 2008
@@ -2979,6 +2979,29 @@
 \end class {install("shunt",2,0); add_creator("demux");}
 
 //****************************************************************
+#include <sys/times.h>
+\class UserTime : FObject {
+	clock_t time;
+	\decl void initialize ();
+	\decl 0 bang ();
+	\decl 1 bang ();
+};
+\def void initialize () {_0_bang(argc,argv);}
+\def 0 bang () {struct tms t; times(&t); time = t.tms_utime;}
+\def 1 bang () {struct tms t; times(&t); outlet_float(bself->out[0],t.tms_utime-time);}
+\end class {install("usertime",2,1);}
+\class SystemTime : FObject {
+	clock_t time;
+	\decl void initialize ();
+	\decl 0 bang ();
+	\decl 1 bang ();
+};
+\def void initialize () {_0_bang(argc,argv);}
+\def 0 bang () {struct tms t; times(&t); time = t.tms_stime;}
+\def 1 bang () {struct tms t; times(&t); outlet_float(bself->out[0],t.tms_stime-time);}
+\end class {install("systemtime",2,1);}
+
+//****************************************************************
 
 #define OP(x) op_dict[string(#x)]
 void startup_flow_objects () {

Modified: trunk/tests/fps-test.pd
==============================================================================
--- trunk/tests/fps-test.pd (original)
+++ trunk/tests/fps-test.pd Mon Apr 14 22:16:46 2008
@@ -15,8 +15,6 @@
 #X obj 32 144 fps;
 #X obj 71 125 fps_ruby;
 #X msg 148 105 mode process;
-#X obj 319 202 systemtime;
-#X obj 319 183 bang;
 #X obj 319 105 print user;
 #X obj 319 221 print system;
 #X obj 327 46 t b b;
@@ -25,9 +23,10 @@
 #X obj 319 86 usertime;
 #X obj 162 239 #out window;
 #X obj 162 201 metro 25;
-#X obj 162 184 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1
+#X obj 162 184 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
 1;
 #X msg 162 220 240 320 3 # 255 0 0;
+#X obj 319 202 systemtime;
 #X connect 0 0 5 0;
 #X connect 1 0 0 0;
 #X connect 2 0 12 0;
@@ -44,13 +43,13 @@
 #X connect 12 0 3 0;
 #X connect 13 0 4 0;
 #X connect 14 0 10 0;
-#X connect 15 0 18 0;
-#X connect 19 0 16 0;
-#X connect 19 0 21 0;
-#X connect 19 1 15 1;
-#X connect 19 1 21 1;
-#X connect 20 0 19 0;
-#X connect 21 0 17 0;
-#X connect 23 0 25 0;
-#X connect 24 0 23 0;
-#X connect 25 0 22 0;
+#X connect 17 0 19 0;
+#X connect 17 0 24 0;
+#X connect 17 1 19 1;
+#X connect 17 1 24 1;
+#X connect 18 0 17 0;
+#X connect 19 0 15 0;
+#X connect 21 0 23 0;
+#X connect 22 0 21 0;
+#X connect 23 0 20 0;
+#X connect 24 0 16 0;



More information about the Gridflow-cvs mailing list