spielwiese
Last change
on this file since ecf019 was
341696,
checked in by Hans Schönemann <hannes@…>, 14 years ago
|
Adding Id property to all files
git-svn-id: file:///usr/local/Singular/svn/trunk@12231 2c84dea3-7e68-4137-9b89-c4e89433aadc
|
-
Property mode set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | /**************************************** |
---|
2 | * Computer Algebra System SINGULAR * |
---|
3 | ****************************************/ |
---|
4 | |
---|
5 | /* $Id$ */ |
---|
6 | |
---|
7 | /*************************************************************** |
---|
8 | * |
---|
9 | * File: mpsr_Timer.cc |
---|
10 | * Purpose: definitions for a simple timer |
---|
11 | * Author: Olaf Bachmann (10/95) |
---|
12 | * |
---|
13 | * Change History (most recent first): |
---|
14 | * |
---|
15 | ***************************************************************/ |
---|
16 | |
---|
17 | #include"mpsr_Timer.h" |
---|
18 | #include<stdio.h> |
---|
19 | |
---|
20 | void mpsr_StartTimer(mpsr_Timer_pt t_mpsr) |
---|
21 | { |
---|
22 | tms t_tms; |
---|
23 | |
---|
24 | t_mpsr->t_time = times(&t_tms); |
---|
25 | t_mpsr->s_time = t_tms.tms_stime; |
---|
26 | t_mpsr->u_time = t_tms.tms_utime; |
---|
27 | } |
---|
28 | |
---|
29 | void mpsr_StopTimer(mpsr_Timer_pt t_mpsr) |
---|
30 | { |
---|
31 | tms t_tms; |
---|
32 | |
---|
33 | t_mpsr->t_time = times(&t_tms) - t_mpsr->t_time; |
---|
34 | t_mpsr->s_time = t_tms.tms_stime - t_mpsr->s_time; |
---|
35 | t_mpsr->u_time = t_tms.tms_utime - t_mpsr->u_time; |
---|
36 | } |
---|
37 | |
---|
38 | void mpsr_PrintTimer(mpsr_Timer_pt t_mpsr, char *str) |
---|
39 | { |
---|
40 | printf("%s", str); |
---|
41 | printf("User time: %.2f \n", (float) t_mpsr->u_time / (float) HZ); |
---|
42 | printf("System time: %.2f \n", (float) t_mpsr->u_time / (float) HZ); |
---|
43 | printf("Real time: %.2f \n", (float) t_mpsr->u_time / (float) HZ); |
---|
44 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.