本文适用于:
E-Prime Go 1.0
细节
要验证参与者机器的时间,请使用以下脚本在 SessionProc 的开头插入一个 InLine 对象。
Sleep 50
‘nTestDuration controls how long to run the test
Const nTestDuration As Long = 2000
Const cMAXBINS As Long = 100
Dim StartTime As Long
‘log the current time
StartTime = Clock.Read
‘ Declare and initialize counter array
Dim i As Long
Dim nBinCnt(cMAXBINS) As Long
For i = 0 To cMAXBINS
nBinCnt(i) = 0
Next i
Dim nThisTime As Long
Dim nLastTime As Long
Dim nEndTime As Long
Dim nDiff As Long
Dim nStartMicro As Long
Dim nStopMicro As Long
Dim nAnalysisStartTime As Long
Dim nAnalysisStopTime As Long
Dim nTotalSamples As Long
Dim nBinSumError As Long
Dim nBinSumErrorLarge As Long
Dim nMaxBin As Long
Dim nErrorSamples As Long
‘ Error Handler
On Error GoTo BinError
‘ Loop until we get a transition
‘ to allow us to start the test
‘ as close to transition as possible
nThisTime = Clock.Read
Do While nThisTime = Clock.Read
‘ DO NOTHING
Loop
nLastTime = nThisTime + 1
nEndTime = nLastTime + nTestDuration
nStartMicro = Clock.ReadMicrosec
Do
‘ Read the clock
nThisTime = Clock.Read
‘ Determine the timing error on this read (if any).
nDiff = nThisTime – nLastTime
‘ Update the count for this bin
‘ NOTE: If the diff is < 0 or > cMAXBINS then
‘ a runtime error will occur and will be trapped below
nBinCnt(nDiff) = nBinCnt(nDiff) + 1
‘ Update for next iteration
nLastTime = nThisTime
Loop While nThisTime < nEndTime
nStopMicro = Clock.ReadMicrosec
nAnalysisStartTime = Clock.Read
‘ Log results
For i = 0 To cMAXBINS
nTotalSamples = nTotalSamples + nBinCnt(i)
If i > 1 Then
nErrorSamples = nErrorSamples + nBinCnt(i)
nBinSumError = nBinSumError + (nBinCnt(i) * (i – 1))
If nBinCnt(i) > 0 Then nMaxBin = i
If i > 11 Then nBinSumErrorLarge = nBinSumErrorLarge + (nBinCnt(i) * (i – 1))
End If
Next i
c.SetAttrib “StartMicro”, nStartMicro
c.SetAttrib “StopMicro”, nStopMicro
c.SetAttrib “TotalSamples”, nTotalSamples
c.SetAttrib “ValidClock”, nBinCnt(1)
c.SetAttrib “ValidClockPercent”, Format(CDbl(nBinCnt(1)) / CDbl(nTestDuration), “0.0000%”)
c.SetAttrib “ValidSamples”, nBinCnt(0) + nBinCnt(1)
c.SetAttrib “ValidSamplesPercent”, Format(CDbl(nBinCnt(0) + nBinCnt(1)) / CDbl(nTotalSamples), “0.0000%”)
c.SetAttrib “ErrorSamples”, nErrorSamples
c.SetAttrib “ErrorSamplesPercent”, Format(CDbl(nErrorSamples) / CDbl(nTotalSamples), “0.0000%”)
c.SetAttrib “SampleRate”, Format(CDbl(nTotalSamples) / CDbl(nTestDuration), “0.0000”)
c.SetAttrib “BinNSumError”, nBinSumError
c.SetAttrib “BinNSumErrorPercent”, Format(CDbl(nBinSumError) / CDbl(nTestDuration), “0.0000%”)
c.SetAttrib “BinNSumErrorLarge”, nBinSumErrorLarge
c.SetAttrib “BinNSumErrorLargePercent”, Format(CDbl(nBinSumErrorLarge) / CDbl(nTestDuration), “0.0000%”)
c.SetAttrib “MaxBin”, nMaxBin
nAnalysisStopTime = Clock.Read
‘Flag if data needs reviewed
Dim bNeedReview As Boolean
bNeedReview = False
If nMaxBin > 10 Then bNeedReview = True
If (CDbl(nBinCnt(1)) / CDbl(nTestDuration)) < 0.99 Then
bNeedReview = True
End If
If (CDbl(nBinSumErrorLarge) / CDbl(nTestDuration)) > 0.01 Then
bNeedReview = True
End If
If (CDbl(nBinSumError) / CDbl(nTestDuration)) > 0.01 Then
bNeedReview = True
End If
If (CDbl(nTotalSamples) / CDbl(nTestDuration)) < 4 Then
bNeedReview = True
End If
c.SetAttrib “ReviewStatus”, IIf(bNeedReview, “Needs Review”, “OK”)
GoTo BinTestComplete
BinError:
c.SetAttrib “ERROR”, “Error happened in bin test and the diff was ” & nDiff
c.SetAttrib “ReviewStatus”, “FAIL”
Resume BinTestComplete
BinTestComplete:
该脚本运行 2 秒钟的测试,以查看计算机是否满足我们的要求。验证数据是否良好的快速方法是查看生成的 .edat3 文件中的 ReviewStatus 列。如果列显示“确定”,则计算机满足我们的要求。如果它显示“需要审查”,则需要更深入地检查数据,以查看是否可以使用数据。如果找到“需要审查”,请查看以下内容:
- SampleRate – 如果小于 4,则机器失败,不应使用数据。如果大于 4,请继续执行下一步。
- BinNSumErrorLargePercent – 注意数据文件中的百分比值。这是超过 11 毫秒的错误百分比。如果高于 0.01%,则不建议使用该数据。
注意:由研究人员确定有多少错误是无关紧要的。
如果 ReviewStatus 列显示“FAIL”,则发生大于 100 毫秒的 bin 错误。可以在 ERROR 列下找到失败的 bin 的错误量。我们不建议使用该数据。
另请参见: