예제 #1
0
파일: time.c 프로젝트: a565109863/src
void
psecs(long l)
{
    int i;

    i = l / 3600;
    if (i) {
	(void) fprintf(cshout, "%d:", i);
	i = l % 3600;
	P2DIG(i / 60);
	goto minsec;
    }
    i = l;
    (void) fprintf(cshout, "%d", i / 60);
minsec:
    i %= 60;
    (void) fputc(':', cshout);
    P2DIG(i);
}
예제 #2
0
파일: time.c 프로젝트: a565109863/src
void
pcsecs(long l)			/* PWP: print mm:ss.dd, l is in sec*100 */
{
    int i;

    i = l / 360000;
    if (i) {
	(void) fprintf(cshout, "%d:", i);
	i = (l % 360000) / 100;
	P2DIG(i / 60);
	goto minsec;
    }
    i = l / 100;
    (void) fprintf(cshout, "%d", i / 60);
minsec:
    i %= 60;
    (void) fputc(':', cshout);
    P2DIG(i);
    (void) fputc('.', cshout);
    P2DIG((int) (l % 100));
}
예제 #3
0
static void
pcsecs(FILE *fp, long l)	/* PWP: print mm:ss.dd, l is in sec*100 */
{
    long i;

    i = l / 360000;
    if (i) {
	(void)fprintf(fp, "%ld:", i);
	i = (l % 360000) / 100;
	P2DIG(fp, i / 60);
	goto minsec;
    }
    i = l / 100;
    (void)fprintf(fp, "%ld", i / 60);
minsec:
    i %= 60;
    (void)fputc(':', fp);
    P2DIG(fp, i);
    (void)fputc('.', fp);
    P2DIG(fp, (l % 100));
}