fieker-DuValspielwiese
Last change
on this file since 584f84d was
32df82,
checked in by Hans Schönemann <hannes@…>, 27 years ago
|
* hannes: removed rcsid and Log: entries,
added assignment module=poly
corected type conversion int->module
git-svn-id: file:///usr/local/Singular/svn/trunk@128 2c84dea3-7e68-4137-9b89-c4e89433aadc
|
-
Property mode set to
100644
|
File size:
1.2 KB
|
Rev | Line | |
---|
[f6b5f0] | 1 | /**************************************** |
---|
| 2 | * Computer Algebra System SINGULAR * |
---|
| 3 | ****************************************/ |
---|
| 4 | |
---|
[32df82] | 5 | /* $Id: mpsr_Timer.cc,v 1.3 1997-04-02 15:07:42 Singular Exp $ */ |
---|
| 6 | |
---|
[0e1846] | 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.