1"use strict";(self.webpackChunkreact_native_website=self.webpackChunkreact_native_website||[]).push([["13598"],{37337(e,t,n){n.r(t),n.d(t,{metadata:()=>r,default:()=>h,frontMatter:()=>o,contentTitle:()=>l,toc:()=>c,assets:()=>d});var r=JSON.parse('{"id":"global-console","title":"console","description":"\u{1F6A7} This page is work in progress, so please refer to the MDN documentation for more information.","source":"@site/versioned_docs/version-0.83/global-console.md","sourceDirName":".","slug":"/global-console","permalink":"/docs/0.83/global-console","draft":false,"unlisted":false,"editUrl":"[{\\"label\\":\\"Edit page for next release\\",\\"href\\":\\"https://github.com/facebook/react-native-website/edit/main/docs/global-console.md\\"},{\\"label\\":\\"Edit page for 0.83 release\\",\\"href\\":\\"https://github.com/facebook/react-native-website/edit/main/website/versioned_docs/version-0.83/global-console.md\\"}]","tags":[],"version":"0.83","lastUpdatedAt":1765899444000,"frontMatter":{"id":"global-console","title":"console"},"sidebar":"api","previous":{"title":"clearTimeout","permalink":"/docs/0.83/global-clearTimeout"},"next":{"title":"EventCounts","permalink":"/docs/0.83/global-EventCounts"}}'),s=n(62540),i=n(43023);let o={id:"global-console",title:"console"},l,d={},c=[{value:"Methods",id:"methods",level:2},{value:"<code>timeStamp()</code>",id:"timestamp",level:3}];function a(e){let t={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",hr:"hr",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,i.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.admonition,{type:"warning",children:(0,s.jsxs)(t.p,{children:["\u{1F6A7} This page is work in progress, so please refer to the ",(0,s.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/console",children:"MDN documentation"})," for more information."]})}),"\n",(0,s.jsxs)(t.p,{children:["The global ",(0,s.jsx)(t.code,{children:"console"})," object, as defined in Web specifications."]}),"\n",(0,s.jsx)(t.hr,{}),"\n",(0,s.jsx)(t.h2,{id:"methods",children:"Methods"}),"\n",(0,s.jsx)(t.h3,{id:"timestamp",children:(0,s.jsx)(t.code,{children:"timeStamp()"})}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-tsx",metastring:'title="React TSX"',children:"console.timeStamp(\n label: string,\n start?: string | number,\n end?: string | number,\n trackName?: string,\n trackGroup?: string,\n color?: DevToolsColor\n): void;\n"})}),"\n",(0,s.jsxs)(t.p,{children:["The ",(0,s.jsx)(t.code,{children:"console.timeStamp"})," API allows you to add custom timing entries in the Performance panel timeline."]}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.strong,{children:"Parameters:"})}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Name"}),(0,s.jsx)(t.th,{children:"Type"}),(0,s.jsx)(t.th,{children:"Required"}),(0,s.jsx)(t.th,{children:"Description"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"label"}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"string"})}),(0,s.jsx)(t.td,{children:"Yes"}),(0,s.jsx)(t.td,{children:"The label for the timing entry."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"start"}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"string | number"})}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:(0,s.jsxs)("ul",{children:[(0,s.jsxs)("li",{children:["If string, the name of a previously recorded timestamp with ",(0,s.jsx)(t.code,{children:"console.timeStamp"}),"."]}),(0,s.jsxs)("li",{children:["If number, the ",(0,s.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/DOMHighResTimeStamp",children:"DOMHighResTimeStamp"}),". For example, from ",(0,s.jsx)(t.code,{children:"performance.now()"}),"."]}),(0,s.jsx)("li",{children:"If undefined, the current time is used."})]})})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"end"}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"string | number"})}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:(0,s.jsxs)("ul",{children:[(0,s.jsxs)("li",{children:["If str
1ing, the name of a previously recorded timestamp with ",(0,s.jsx)(t.code,{children:"console.timeStamp"}),"."]}),(0,s.jsxs)("li",{children:["If number, the ",(0,s.jsx)(t.a,{href:"https://developer.mozilla.org/en-US/docs/Web/API/DOMHighResTimeStamp",children:"DOMHighResTimeStamp"}),". For example, from ",(0,s.jsx)(t.code,{children:"performance.now()"}),"."]}),(0,s.jsx)("li",{children:"If undefined, the current time is used."})]})})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"trackName"}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"string"})}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"The name of the custom track."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"trackGroup"}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"string"})}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"The name of the track group."})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"color"}),(0,s.jsx)(t.td,{children:(0,s.jsx)(t.code,{children:"DevToolsColor"})}),(0,s.jsx)(t.td,{children:"No"}),(0,s.jsx)(t.td,{children:"The color of the entry."})]})]})]}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-tsx",metastring:'title="React TSX"',children:"type DevToolsColor =\n | 'primary'\n | 'primary-light'\n | 'primary-dark'\n | 'secondary'\n | 'secondary-light'\n | 'secondary-dark'\n | 'tertiary'\n | 'tertiary-light'\n | 'tertiary-dark'\n | 'warning'\n | 'error';\n"})})]})}function h(e={}){let{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(a,{...e})}):a(e)}},43023(e,t,n){n.d(t,{R:()=>o,x:()=>l});var r=n(63696);let s={},i=r.createContext(s);function o(e){let t=r.useContext(i);return r.useMemo(function(){return"function"==typeof e?e(t):{...t,...e}},[t,e])}function l(e){let t;return t=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:o(e.components),r.createElement(i.Provider,{value:t},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.