]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.1.14
authorfred <fred>
Fri, 12 Sep 1997 22:30:23 +0000 (22:30 +0000)
committerfred <fred>
Fri, 12 Sep 1997 22:30:23 +0000 (22:30 +0000)
flower/cpu-timer.cc [new file with mode: 0644]

diff --git a/flower/cpu-timer.cc b/flower/cpu-timer.cc
new file mode 100644 (file)
index 0000000..e10985e
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+  cpu-timer.cc -- implement Cpu_timer
+
+  source file of the Flower Library
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#include "cpu-timer.hh"
+
+Cpu_timer::Cpu_timer ()
+{
+  restart ();
+}
+void
+Cpu_timer::restart ()
+{
+  start_clock_ = clock ();
+}
+
+Real
+Cpu_timer::read ()
+{
+  clock_t stop = clock ();
+  return (stop-start_clock_)/Real(CLOCKS_PER_SEC);
+}