/*
 * $Id: loadtime.h,v 1.1 2003/02/07 18:15:44 wheeler Exp $
 *
 * $Log: loadtime.h,v $
 * Revision 1.1  2003/02/07 18:15:44  wheeler
 * Fox's version of libultra and friends.
 *
 * Revision 1.4  1996/11/21  06:30:11  hayakawa
 * インクルードするべきファイルをインクルードしていなかった
 *
 * Revision 1.3  1996/10/20  09:13:26  hayakawa
 * _LANGUAGE_C_PLUS_PLUS を __cplusplus に変更
 *
 */

#ifndef __LOADTIME_H_
#define __LOADTIME_H_

#include "ultra64.h"

typedef volatile struct load_time_s {
    OSThread *osthread;
    u16    state;		/* OS_STATE_* */
    OSTime start_time;		/* 計測開始時刻 */
    OSTime end_time;		/* 計測終了時刻 */
    OSTime sum_time;		/* １計測の時間 */
    OSTime frame_time;		/* １描画にかかった時間 */
    OSTime frame_time_ave;	/* １描画にかかった時間の平均 */
    int count;			/* 計測回数 */
} load_time_t;

#ifdef __cplusplus
extern "C" {
#endif

void
loadtime_CreateThread(
    OSId threadid,
    OSThread *osthread
);
void
loadtime_StartThread(
    OSId threadid
);
void
loadtime_PostMesg(void);
void
loadtime_PreMesg(void);
void
loadtime_finish(void);

#ifdef __cplusplus
} /* extern "C" */
#endif

/*
 * 各スレッド用タイマーバッファ
 */
extern load_time_t loadtime_tbl[THREAD_ID_MAX];

#endif
