~ubuntu-branches/ubuntu/precise/lilypond/precise

« back to all changes in this revision

Viewing changes to flower/cpu-timer.cc

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Bushnell, BSG
  • Date: 2006-12-19 10:18:12 UTC
  • mfrom: (3.1.4 feisty)
  • Revision ID: james.westby@ubuntu.com-20061219101812-7awtjkp0i393wxty
Tags: 2.8.7-3
scripts/midi2ly.py: When setting DATADIR, find Lilypond python files
in the @TOPLEVEL_VERSION@ directory, not 'current'.  Patch thanks to
Chris Lamb (chris@chris-lamb.co.uk).  (Closes: #400550)

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 
4
4
  source file of the Flower Library
5
5
 
6
 
  (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 
6
  (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
7
7
*/
8
8
 
9
9
#include "cpu-timer.hh"
 
10
 
10
11
#include <unistd.h>
11
12
// nextstep
12
13
#ifndef CLOCKS_PER_SEC
13
14
#ifdef CLK_TCK
14
 
#define CLOCKS_PER_SEC  CLK_TCK
 
15
#define CLOCKS_PER_SEC CLK_TCK
15
16
#elif defined _SC_CLK_TCK
16
 
#define CLOCKS_PER_SEC  sysconf (_SC_CLK_TCK)
 
17
#define CLOCKS_PER_SEC sysconf (_SC_CLK_TCK)
17
18
#else
18
19
#error cannot determine CLOCKS_PER_SEC
19
20
#endif
20
21
#endif
21
22
 
22
 
 
23
23
Cpu_timer::Cpu_timer ()
24
24
{
25
25
  restart ();
34
34
Cpu_timer::read ()
35
35
{
36
36
  clock_t stop = clock ();
37
 
  return (stop-start_clock_)/Real (CLOCKS_PER_SEC);
 
37
  return (stop - start_clock_) / Real (CLOCKS_PER_SEC);
38
38
}