AABB
AlignmentBehavior
ArriveBehavior
AStar
BFS
BoundingSphere
BVH
BVHNode
Cell
CellSpacePartitioning
CohesionBehavior
CompositeGoal
ConvexHull
Corridor
CostTable
DFS
Dijkstra
Edge
EntityManager
EvadeBehavior
EventDispatcher
Behavior
FollowPathBehavior
FuzzyAND
FuzzyCompositeTerm
FuzzyFAIRLY
FuzzyModule
FuzzyOR
FuzzyRule
FuzzySet
FuzzyTerm
FuzzyVariable
FuzzyVERY
GameEntity
Goal
GoalEvaluator
Graph
GraphUtils
HalfEdge
HeuristicPolicyDijkstra
HeuristicPolicyEuclid
HeuristicPolicyEuclidSquared
HeuristicPolicyManhattan
InterposeBehavior
LeftSCurveFuzzySet
LeftShoulderFuzzySet
LineSegment
Logger
MathUtils
Matrix3
Matrix4
MemoryRecord
MemorySystem
MeshGeometry
MessageDispatcher
MovingEntity
NavEdge
NavMesh
NavMeshLoader
NavNode
Node
NormalDistFuzzySet
OBB
ObstacleAvoidanceBehavior
OffsetPursuitBehavior
OnPathBehavior
Path
Plane
Polygon
Polyhedron
PriorityQueue
PursuitBehavior
Quaternion
Ray
RectangleTriggerRegion
Regular
RightSCurveFuzzySet
RightShoulderFuzzySet
SAT
SeekBehavior
SeparationBehavior
SingletonFuzzySet
Smoother
SphericalTriggerRegion
State
StateMachine
SteeringBehavior
SteeringManager
Task
TaskQueue
Telegram
Think
Time
TriangularFuzzySet
Trigger
TriggerRegion
Vector3
Vehicle
Version
WanderBehavior

timeBecameVisible

描述

timeBecameVisible 方法是 MemoryRecord 对象的一个属性,用于记录该对象在页面中首次变为可见状态的时间。该方法返回一个时间戳,单位为毫秒。

语法

memoryRecord.timeBecameVisible();

示例

const memoryRecord = new MemoryRecord();
const startTime = memoryRecord.timeBecameVisible();
console.log(`该对象在页面中首次变为可见状态的时间戳为:${startTime}`);

注意事项

  • 该方法只能在浏览器中使用。
  • 如果该对象一直处于隐藏状态,则该方法返回值为 undefined
  • 如果该对象在页面首次加载时就已经可见,则该方法返回值为页面加载完成的时间戳。

浏览器兼容性

Chrome Edge Firefox IE Opera Safari
13+ 18+ 1.5+ 9+ 12+ 4+

参考链接