PoA_PRC8/_module/nss/nwnx_time_t.nss
Jaysyn904 8d97886c3f Changed folder name.
Changed folder name.
2022-10-07 21:08:37 -04:00

26 lines
1.2 KiB
Plaintext

#include "nwnx_time"
void main()
{
WriteTimestampedLogEntry("NWNX_Time unit test begin..");
struct NWNX_Time_HighResTimestamp t1 = NWNX_Time_GetHighResTimeStamp();
// waste some time..
DestroyObject(CreateObject(OBJECT_TYPE_CREATURE, "nw_chicken", GetStartingLocation()));
DestroyObject(CreateObject(OBJECT_TYPE_CREATURE, "nw_chicken", GetStartingLocation()));
DestroyObject(CreateObject(OBJECT_TYPE_CREATURE, "nw_chicken", GetStartingLocation()));
DestroyObject(CreateObject(OBJECT_TYPE_CREATURE, "nw_chicken", GetStartingLocation()));
struct NWNX_Time_HighResTimestamp t2 = NWNX_Time_GetHighResTimeStamp();
if (t1.microseconds == t2.microseconds) // yeah, chance of again triggering
WriteTimestampedLogEntry("GetHighResTimeStamp failed");
else
WriteTimestampedLogEntry("GetHighResTimeStamp succeed");
WriteTimestampedLogEntry("t1.seconds: " + IntToString(t1.seconds) + "; " +
"t1.microseconds: " + IntToString(t1.microseconds) + "; " +
"t2.seconds: " + IntToString(t2.seconds) + "; " +
"t2.microseconds: " + IntToString(t2.microseconds) + "; ");
}