]> git.donarmstrong.com Git - lilypond.git/blob - flower/cpu-timer.cc
release: 0.1.14
[lilypond.git] / flower / cpu-timer.cc
1 /*
2   cpu-timer.cc -- implement Cpu_timer
3
4   source file of the Flower Library
5
6   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8
9 #include "cpu-timer.hh"
10
11 Cpu_timer::Cpu_timer ()
12 {
13   restart ();
14 }
15 void
16 Cpu_timer::restart ()
17 {
18   start_clock_ = clock ();
19 }
20
21 Real
22 Cpu_timer::read ()
23 {
24   clock_t stop = clock ();
25   return (stop-start_clock_)/Real(CLOCKS_PER_SEC);
26 }